2 * long sys_clone(unsigned long clone_flags, unsigned long newsp,
3 void __user *parent_tid, void __user *child_tid, struct pt_regs *regs)
4 * On success, the thread ID of the child process is returned in the caller's thread of execution.
5 * On failure, -1 is returned in the caller's context, no child process will be created, and errno will be set appropriately.
8 #include <linux/sched.h>
11 struct syscallentry syscall_clone
= {
14 .flags
= AVOID_SYSCALL
,
15 .arg1name
= "clone_flags",
20 CLONE_VM
, CLONE_FS
, CLONE_FILES
, CLONE_SIGHAND
,
21 CLONE_PTRACE
, CLONE_VFORK
, CLONE_PARENT
, CLONE_THREAD
,
22 CLONE_NEWNS
, CLONE_SYSVSEM
, CLONE_SETTLS
, CLONE_PARENT_SETTID
,
23 CLONE_CHILD_CLEARTID
, CLONE_DETACHED
, CLONE_UNTRACED
, CLONE_CHILD_SETTID
,
24 CLONE_NEWUTS
, CLONE_NEWIPC
, CLONE_NEWUSER
, CLONE_NEWPID
,
25 CLONE_NEWNET
, CLONE_IO
},
28 .arg2type
= ARG_ADDRESS
,
29 .arg3name
= "parent_tid",
30 .arg3type
= ARG_ADDRESS
,
31 .arg4name
= "child_tid",
32 .arg4type
= ARG_ADDRESS
,
34 .arg5type
= ARG_ADDRESS
,
41 * sys_clone2(u64 flags, u64 ustack_base, u64 ustack_size, u64 parent_tidptr, u64 child_tidptr, u64 tls)
43 * On success, the thread ID of the child process is returned in the caller's thread of execution.
44 * On failure, -1 is returned in the caller's context, no child process will be created, and errno will be set appropriately.
47 struct syscallentry syscall_clone2
= {
50 .flags
= AVOID_SYSCALL
,
56 CLONE_VM
, CLONE_FS
, CLONE_FILES
, CLONE_SIGHAND
,
57 CLONE_PTRACE
, CLONE_VFORK
, CLONE_PARENT
, CLONE_THREAD
,
58 CLONE_NEWNS
, CLONE_SYSVSEM
, CLONE_SETTLS
, CLONE_PARENT_SETTID
,
59 CLONE_CHILD_CLEARTID
, CLONE_DETACHED
, CLONE_UNTRACED
, CLONE_CHILD_SETTID
,
60 CLONE_NEWUTS
, CLONE_NEWIPC
, CLONE_NEWUSER
, CLONE_NEWPID
,
61 CLONE_NEWNET
, CLONE_IO
},
63 .arg2name
= "ustack_base",
64 .arg2type
= ARG_ADDRESS
,
65 .arg3name
= "ustack_size",
67 .arg4name
= "parent_tidptr",
68 .arg4type
= ARG_ADDRESS
,
69 .arg5name
= "child_tidptr",
70 .arg5type
= ARG_ADDRESS
,
72 .arg6type
= ARG_ADDRESS
,