[PATCH 2/3] tests/clock_nanosleep: Skip test if __NR_clock_nanosleep isn't defined

Alistair Francis alistair.francis at wdc.com
Fri Feb 14 19:40:27 UTC 2020


Modern (added since Linux kernel 5.1+) 32-bit architectures don't have
the __NR_clock_nanosleep syscall, if we don't have the syscall let's
skip the test.

Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
---
 tests/clock_nanosleep.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/clock_nanosleep.c b/tests/clock_nanosleep.c
index d7ed269a..966abfc5 100644
--- a/tests/clock_nanosleep.c
+++ b/tests/clock_nanosleep.c
@@ -18,6 +18,9 @@
 #include <sys/time.h>
 #include "scno.h"
 
+
+#ifdef __NR_clock_nanosleep
+
 static void
 handler(int signo)
 {
@@ -127,3 +130,9 @@ main(void)
 	puts("+++ exited with 0 +++");
 	return 0;
 }
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_clock_nanosleep")
+
+#endif
-- 
2.25.0



More information about the Strace-devel mailing list