document clone3 and struct clone_args
Subsystems (3)
cover document clone3 and struct clone_args
Hey,
This adds missing kernel-docs for the clone3() syscall and its argument struct clone_args. I somehow failed to add this right away.
I intend to include this in my rc2 pull request.
Thanks!
Christian
Christian Brauner (2):
fork: add kernel-doc for clone3
sched: add kernel-doc for struct clone_args
include/uapi/linux/sched.h | 26 ++++++++++++++++++++++++-- kernel/fork.c | 11 +++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-)
Signature · 1 line
2.23.0
PATCH 1/2 fork: add kernel-doc for clone3
Add kernel-doc for the clone3() syscall.
Signed-off-by Christian Brauner <[email protected]>
--- kernel/fork.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
kernel/fork.c +11 -0
@@ -2590,6 +2590,17 @@ static bool clone3_args_valid(const struct kernel_clone_args *kargs)return true; } +/** +* clone3 - create a new process with specific properties +* @uargs: argument structure +* @size: size of @uargs +* +* clone3() is the extensible successor to clone()/clone2(). +* It takes a struct as argument that is versioned by its size. +* +* Return: On success, a positive PID for the child process. +* On error, a negative errno number. +*/ SYSCALL_DEFINE2(clone3, struct clone_args __user *, uargs, size_t, size) {int err;
Signature · 1 line
2.23.0
PATCH 2/2 sched: add kernel-doc for struct clone_args
In reply to Christian BraunerAdd kernel-doc for struct clone_args for the clone3() syscall.
Signed-off-by Christian Brauner <[email protected]>
--- include/uapi/linux/sched.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
include/uapi/linux/sched.h +24 -2
@@ -34,8 +34,30 @@#define CLONE_IO 0x80000000/* Clone io context */ #ifndef __ASSEMBLY__ -/* - * Arguments for the clone3 syscall +/** + * struct clone_args - arguments for the clone3 syscall + * @flags: Flags for the new process as listed above. + * All flags are valid except for CSIGNAL and + * CLONE_DETACHED. + * @pidfd: If CLONE_PIDFD is set, a pidfd will be + * returned in this argument. + * @child_tid: If CLONE_CHILD_SETTID is set, the TID of the + * child process will be returned in the child's + * memory. + * @parent_tid: If CLONE_PARENT_SETTID is set, the TID of + * the child process will be returned in the + * parent's memory. + * @exit_signal: The exit_signal the parent process will be + * sent when the child exits. + * @stack: Specify the location of the stack for the + * child process. + * @stack_size: The size of the stack for the child process. + * @tls: If CLONE_SETTLS is set, the tls descriptor + * is set to tls. + * + * The structure is versioned by size and thus extensible. + * New struct members must go at the end of the struct and + * must be properly 64bit aligned. */ struct clone_args { __aligned_u64 flags;
Signature · 1 line
2.23.0