Skip to content

Commit 2603a49

Browse files
committed
tools headers UAPI: Sync sched.h with the kernel
To get the changes in: 0acefef ("Merge tag 'threads-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux") 49cb2fc ("fork: extend clone3() to support setting a PID") fa729c4 ("clone3: validate stack arguments") b612e5d ("clone3: add CLONE_CLEAR_SIGHAND") This file gets rebuilt, but no changes ensues: CC /tmp/build/perf/trace/beauty/clone.o This addresses this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h' diff -u tools/include/uapi/linux/sched.h include/uapi/linux/sched. The CLONE_CLEAR_SIGHAND one will be used in tools/perf/trace/beauty/clone.c in a followup patch to show that string when this bit is set in the syscall arg. Keeping a copy of this file allows us to build this in older systems and have the binary support printing that flag whenever that system gets its kernel updated to one where this feature is present. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Adrian Reber <areber@redhat.com> Cc: Christian Brauner <christian.brauner@ubuntu.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-nprqsvvzbhzoy64cbvos6c5b@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 1fc3d0e commit 2603a49

1 file changed

Lines changed: 42 additions & 18 deletions

File tree

‎tools/include/uapi/linux/sched.h‎

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,48 @@
3333
#define CLONE_NEWNET 0x40000000 /* New network namespace */
3434
#define CLONE_IO 0x80000000 /* Clone io context */
3535

36+
/* Flags for the clone3() syscall. */
37+
#define CLONE_CLEAR_SIGHAND 0x100000000ULL /* Clear any signal handler and reset to SIG_DFL. */
38+
3639
#ifndef __ASSEMBLY__
3740
/**
3841
* 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.
42+
* @flags: Flags for the new process as listed above.
43+
* All flags are valid except for CSIGNAL and
44+
* CLONE_DETACHED.
45+
* @pidfd: If CLONE_PIDFD is set, a pidfd will be
46+
* returned in this argument.
47+
* @child_tid: If CLONE_CHILD_SETTID is set, the TID of the
48+
* child process will be returned in the child's
49+
* memory.
50+
* @parent_tid: If CLONE_PARENT_SETTID is set, the TID of
51+
* the child process will be returned in the
52+
* parent's memory.
53+
* @exit_signal: The exit_signal the parent process will be
54+
* sent when the child exits.
55+
* @stack: Specify the location of the stack for the
56+
* child process.
57+
* Note, @stack is expected to point to the
58+
* lowest address. The stack direction will be
59+
* determined by the kernel and set up
60+
* appropriately based on @stack_size.
61+
* @stack_size: The size of the stack for the child process.
62+
* @tls: If CLONE_SETTLS is set, the tls descriptor
63+
* is set to tls.
64+
* @set_tid: Pointer to an array of type *pid_t. The size
65+
* of the array is defined using @set_tid_size.
66+
* This array is used to select PIDs/TIDs for
67+
* newly created processes. The first element in
68+
* this defines the PID in the most nested PID
69+
* namespace. Each additional element in the array
70+
* defines the PID in the parent PID namespace of
71+
* the original PID namespace. If the array has
72+
* less entries than the number of currently
73+
* nested PID namespaces only the PIDs in the
74+
* corresponding namespaces are set.
75+
* @set_tid_size: This defines the size of the array referenced
76+
* in @set_tid. This cannot be larger than the
77+
* kernel's limit of nested PID namespaces.
5778
*
5879
* The structure is versioned by size and thus extensible.
5980
* New struct members must go at the end of the struct and
@@ -68,10 +89,13 @@ struct clone_args {
6889
__aligned_u64 stack;
6990
__aligned_u64 stack_size;
7091
__aligned_u64 tls;
92+
__aligned_u64 set_tid;
93+
__aligned_u64 set_tid_size;
7194
};
7295
#endif
7396

7497
#define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */
98+
#define CLONE_ARGS_SIZE_VER1 80 /* sizeof second published struct */
7599

76100
/*
77101
* Scheduling policies

0 commit comments

Comments
 (0)