lkml.org 
[lkml]   [2016]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] userfaultfd: fix compilation on 32bit host
Date
Use PRId64/PRIu64 instead of Ld/Lu as we are in userspace
and values are __s64/__u64

Signed-off-by: Laurent Vivier <laurent@vivier.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
\
 
 \ /
  Last update: 2016-11-16 17:39    [W:0.146 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site