summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/clone3/clone3_clear_sighand.c
diff options
context:
space:
mode:
authorAdrian Reber <areber@redhat.com>2019-11-15 15:36:21 +0300
committerChristian Brauner <christian.brauner@ubuntu.com>2019-11-16 01:49:51 +0300
commit41585bbeeef9402d5d65687747e04246ef4a3a41 (patch)
treef77af763bae9cc64a23680b1f43321e88f9717e7 /tools/testing/selftests/clone3/clone3_clear_sighand.c
parent49cb2fc42ce4b7a656ee605e30c302efaa39c1a7 (diff)
downloadlinux-41585bbeeef9402d5d65687747e04246ef4a3a41.tar.xz
selftests: add tests for clone3() with *set_tid
This tests clone3() with *set_tid to see if all desired PIDs are working as expected. The tests are trying multiple invalid input parameters as well as creating processes while specifying a certain PID in multiple PID namespaces at the same time. Additionally this moves common clone3() test code into clone3_selftests.h. Signed-off-by: Adrian Reber <areber@redhat.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Link: https://lore.kernel.org/r/20191115123621.142252-2-areber@redhat.com Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'tools/testing/selftests/clone3/clone3_clear_sighand.c')
-rw-r--r--tools/testing/selftests/clone3/clone3_clear_sighand.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c
index 0d957be1bdc5..456783ad19d6 100644
--- a/tools/testing/selftests/clone3/clone3_clear_sighand.c
+++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c
@@ -14,30 +14,12 @@
#include <sys/wait.h>
#include "../kselftest.h"
+#include "clone3_selftests.h"
#ifndef CLONE_CLEAR_SIGHAND
#define CLONE_CLEAR_SIGHAND 0x100000000ULL
#endif
-#ifndef __NR_clone3
-#define __NR_clone3 -1
-struct clone_args {
- __aligned_u64 flags;
- __aligned_u64 pidfd;
- __aligned_u64 child_tid;
- __aligned_u64 parent_tid;
- __aligned_u64 exit_signal;
- __aligned_u64 stack;
- __aligned_u64 stack_size;
- __aligned_u64 tls;
-};
-#endif
-
-static pid_t sys_clone3(struct clone_args *args, size_t size)
-{
- return syscall(__NR_clone3, args, size);
-}
-
static void test_clone3_supported(void)
{
pid_t pid;