Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-20191003' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux

Pull clone3/pidfd fixes from Christian Brauner:
"This contains a couple of fixes:

- Fix pidfd selftest compilation (Shuah Kahn)

Due to a false linking instruction in the Makefile compilation for
the pidfd selftests would fail on some systems.

- Fix compilation for glibc on RISC-V systems (Seth Forshee)

In some scenarios linux/uapi/linux/sched.h is included where
__ASSEMBLY__ is defined causing a build failure because struct
clone_args was not guarded by an #ifndef __ASSEMBLY__.

- Add missing clone3() and struct clone_args kernel-doc (Christian Brauner)

clone3() and struct clone_args were missing kernel-docs. (The goal
is to use kernel-doc for any function or type where it's worth it.)
For struct clone_args this also contains a comment about the fact
that it's versioned by size"

* tag 'for-linus-20191003' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
sched: add kernel-doc for struct clone_args
fork: add kernel-doc for clone3
selftests: pidfd: Fix undefined reference to pthread_create()
sched: Add __ASSEMBLY__ guards around struct clone_args

+38 -3
+26 -2
include/uapi/linux/sched.h
··· 33 33 #define CLONE_NEWNET 0x40000000 /* New network namespace */ 34 34 #define CLONE_IO 0x80000000 /* Clone io context */ 35 35 36 - /* 37 - * Arguments for the clone3 syscall 36 + #ifndef __ASSEMBLY__ 37 + /** 38 + * struct clone_args - arguments for the clone3 syscall 39 + * @flags: Flags for the new process as listed above. 40 + * All flags are valid except for CSIGNAL and 41 + * CLONE_DETACHED. 42 + * @pidfd: If CLONE_PIDFD is set, a pidfd will be 43 + * returned in this argument. 44 + * @child_tid: If CLONE_CHILD_SETTID is set, the TID of the 45 + * child process will be returned in the child's 46 + * memory. 47 + * @parent_tid: If CLONE_PARENT_SETTID is set, the TID of 48 + * the child process will be returned in the 49 + * parent's memory. 50 + * @exit_signal: The exit_signal the parent process will be 51 + * sent when the child exits. 52 + * @stack: Specify the location of the stack for the 53 + * child process. 54 + * @stack_size: The size of the stack for the child process. 55 + * @tls: If CLONE_SETTLS is set, the tls descriptor 56 + * is set to tls. 57 + * 58 + * The structure is versioned by size and thus extensible. 59 + * New struct members must go at the end of the struct and 60 + * must be properly 64bit aligned. 38 61 */ 39 62 struct clone_args { 40 63 __aligned_u64 flags; ··· 69 46 __aligned_u64 stack_size; 70 47 __aligned_u64 tls; 71 48 }; 49 + #endif 72 50 73 51 /* 74 52 * Scheduling policies
+11
kernel/fork.c
··· 2604 2604 return true; 2605 2605 } 2606 2606 2607 + /** 2608 + * clone3 - create a new process with specific properties 2609 + * @uargs: argument structure 2610 + * @size: size of @uargs 2611 + * 2612 + * clone3() is the extensible successor to clone()/clone2(). 2613 + * It takes a struct as argument that is versioned by its size. 2614 + * 2615 + * Return: On success, a positive PID for the child process. 2616 + * On error, a negative errno number. 2617 + */ 2607 2618 SYSCALL_DEFINE2(clone3, struct clone_args __user *, uargs, size_t, size) 2608 2619 { 2609 2620 int err;
+1 -1
tools/testing/selftests/pidfd/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -g -I../../../../usr/include/ -lpthread 2 + CFLAGS += -g -I../../../../usr/include/ -pthread 3 3 4 4 TEST_GEN_PROGS := pidfd_test pidfd_open_test pidfd_poll_test pidfd_wait 5 5