[PATCH] tests/userfaultfd: fix invalid flag testing

Sven Schnelle svens at linux.ibm.com
Sun Jan 3 18:51:18 UTC 2021


With linux commit 37cd0575b851 ("userfaultfd: add UFFD_USER_MODE_ONLY")
flag with value 1 is now a valid flag. This commit changes it to 2 as
that one is the next available. It doesn't implement any testing of
UFFD_USER_MODE_ONLY though.

Signed-off-by: Sven Schnelle <svens at linux.ibm.com>
---
 tests/userfaultfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/userfaultfd.c b/tests/userfaultfd.c
index fa722577..9070a292 100644
--- a/tests/userfaultfd.c
+++ b/tests/userfaultfd.c
@@ -18,8 +18,8 @@
 int
 main(void)
 {
-	long rc = syscall(__NR_userfaultfd, 1 | O_NONBLOCK | O_CLOEXEC);
-	printf("userfaultfd(O_NONBLOCK|O_CLOEXEC|0x1) = %ld %s (%m)\n",
+	long rc = syscall(__NR_userfaultfd, 2 | O_NONBLOCK | O_CLOEXEC);
+	printf("userfaultfd(O_NONBLOCK|O_CLOEXEC|0x2) = %ld %s (%m)\n",
 	       rc, errno2name());
 	puts("+++ exited with 0 +++");
 	return 0;
-- 
2.17.1



More information about the Strace-devel mailing list