Message ID | 20180828172608.30075-3-bauerman@linux.ibm.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | userfaultfd: selftest: Improve behavior with older kernels | expand |
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index e4099afe7557..d728bd1cb33c 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -636,9 +636,11 @@ static int userfaultfd_open(int features) uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK); if (uffd < 0) { - fprintf(stderr, - "userfaultfd syscall not available in this kernel\n"); - return 1; + int errnum = errno; + + perror("userfaultfd syscall not available in this kernel"); + + exit(errnum == ENOSYS ? KSFT_SKIP : 1); } uffd_flags = fcntl(uffd, F_GETFD, NULL);