aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/clone3/clone3_clear_sighand.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/clone3/clone3_clear_sighand.c')
-rw-r--r--tools/testing/selftests/clone3/clone3_clear_sighand.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c
index 456783ad19d6..9e1af8aa7698 100644
--- a/tools/testing/selftests/clone3/clone3_clear_sighand.c
+++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c
@@ -20,32 +20,6 @@
#define CLONE_CLEAR_SIGHAND 0x100000000ULL
#endif
-static void test_clone3_supported(void)
-{
- pid_t pid;
- struct clone_args args = {};
-
- if (__NR_clone3 < 0)
- ksft_exit_skip("clone3() syscall is not supported\n");
-
- /* Set to something that will always cause EINVAL. */
- args.exit_signal = -1;
- pid = sys_clone3(&args, sizeof(args));
- if (!pid)
- exit(EXIT_SUCCESS);
-
- if (pid > 0) {
- wait(NULL);
- ksft_exit_fail_msg(
- "Managed to create child process with invalid exit_signal\n");
- }
-
- if (errno == ENOSYS)
- ksft_exit_skip("clone3() syscall is not supported\n");
-
- ksft_print_msg("clone3() syscall supported\n");
-}
-
static void nop_handler(int signo)
{
}
@@ -145,9 +119,10 @@ static void test_clone3_clear_sighand(void)
int main(int argc, char **argv)
{
ksft_print_header();
+ test_clone3_supported();
+
ksft_set_plan(1);
- test_clone3_supported();
test_clone3_clear_sighand();
return ksft_exit_pass();