diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2019-11-18 08:49:44 +0100 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2019-11-18 08:59:03 +0100 |
commit | 11fde161ab37f2938504bf896b48afbd18ea71cd (patch) | |
tree | a6469cc26af328bb9df220ec19732d1332d1390b /tools/testing/selftests/clone3/clone3_set_tid.c | |
parent | a019ff3b8b10d1b7f5cd37edb9f4fbef3e031edf (diff) | |
download | lwn-11fde161ab37f2938504bf896b48afbd18ea71cd.tar.gz lwn-11fde161ab37f2938504bf896b48afbd18ea71cd.zip |
selftests/clone3: skip if clone3() is ENOSYS
If the clone3() syscall is not implemented we should skip the tests.
Fixes: 41585bbeeef9 ("selftests: add tests for clone3() with *set_tid")
Fixes: 17a810699c18 ("selftests: add tests for clone3()")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'tools/testing/selftests/clone3/clone3_set_tid.c')
-rw-r--r-- | tools/testing/selftests/clone3/clone3_set_tid.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/selftests/clone3/clone3_set_tid.c b/tools/testing/selftests/clone3/clone3_set_tid.c index c6309f5d7d88..25beb22f35b5 100644 --- a/tools/testing/selftests/clone3/clone3_set_tid.c +++ b/tools/testing/selftests/clone3/clone3_set_tid.c @@ -156,12 +156,13 @@ int main(int argc, char *argv[]) pid_t pid, ns1, ns2, ns3, ns_pid; pid_t set_tid[MAX_PID_NS_LEVEL * 2]; - if (pipe(pipe_1) < 0 || pipe(pipe_2) < 0) - ksft_exit_fail_msg("pipe() failed\n"); - ksft_print_header(); + test_clone3_supported(); ksft_set_plan(29); + if (pipe(pipe_1) < 0 || pipe(pipe_2) < 0) + ksft_exit_fail_msg("pipe() failed\n"); + f = fopen("/proc/sys/kernel/pid_max", "r"); if (f == NULL) ksft_exit_fail_msg( |