lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1479314330-16475-1-git-send-email-laurent@vivier.eu>
Date:   Wed, 16 Nov 2016 17:38:50 +0100
From:   Laurent Vivier <laurent@...ier.eu>
To:     linux-kernel@...r.kernel.org
Cc:     linux-kselftest@...r.kernel.org, Shuah Khan <shuah@...nel.org>,
        Laurent Vivier <laurent@...ier.eu>
Subject: [PATCH] userfaultfd: fix compilation on 32bit host

Use PRId64/PRIu64 instead of Ld/Lu as we are in userspace
and values are __s64/__u64

Signed-off-by: Laurent Vivier <laurent@...ier.eu>
---
 tools/testing/selftests/vm/userfaultfd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index d77ed41..685536a 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -65,6 +65,7 @@
 #include <sys/ioctl.h>
 #include <pthread.h>
 #include <linux/userfaultfd.h>
+#include <inttypes.h>
 
 #ifdef __NR_userfaultfd
 
@@ -232,10 +233,10 @@ static int copy_page(unsigned long offset)
 	if (ioctl(uffd, UFFDIO_COPY, &uffdio_copy)) {
 		/* real retval in ufdio_copy.copy */
 		if (uffdio_copy.copy != -EEXIST)
-			fprintf(stderr, "UFFDIO_COPY error %Ld\n",
+			fprintf(stderr, "UFFDIO_COPY error %"PRId64"\n",
 				uffdio_copy.copy), exit(1);
 	} else if (uffdio_copy.copy != page_size) {
-		fprintf(stderr, "UFFDIO_COPY unexpected copy %Ld\n",
+		fprintf(stderr, "UFFDIO_COPY unexpected copy %"PRId64"\n",
 			uffdio_copy.copy), exit(1);
 	} else
 		return 1;
@@ -451,7 +452,7 @@ static int userfaultfd_stress(void)
 		return 1;
 	}
 	if (uffdio_api.api != UFFD_API) {
-		fprintf(stderr, "UFFDIO_API error %Lu\n", uffdio_api.api);
+		fprintf(stderr, "UFFDIO_API error %"PRIu64"\n", uffdio_api.api);
 		return 1;
 	}
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ