diff options
author | Mike Christie <michael.christie@oracle.com> | 2023-03-10 16:03:23 -0600 |
---|---|---|
committer | Christian Brauner (Microsoft) <brauner@kernel.org> | 2023-03-12 10:52:46 +0100 |
commit | cf587db2ee0261c74d04f61f39783db88a0b65e4 (patch) | |
tree | 5fecb82e0ea27438d473a165f274b9355ce0cd42 /include/linux/sched | |
parent | e0a98139c162af9601ffa8d6db88dbe745f64b3c (diff) | |
download | lwn-cf587db2ee0261c74d04f61f39783db88a0b65e4.tar.gz lwn-cf587db2ee0261c74d04f61f39783db88a0b65e4.zip |
kernel: Allow a kernel thread's name to be set in copy_process
This patch allows kernel users to pass in the thread name so it can be
set during creation instead of having to use set_task_comm after the
thread is created.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'include/linux/sched')
-rw-r--r-- | include/linux/sched/task.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index 357e0068497c..32c9f01af0a6 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h @@ -23,6 +23,7 @@ struct kernel_clone_args { int __user *pidfd; int __user *child_tid; int __user *parent_tid; + const char *name; int exit_signal; unsigned long stack; unsigned long stack_size; @@ -91,7 +92,8 @@ extern void exit_itimers(struct task_struct *); extern pid_t kernel_clone(struct kernel_clone_args *kargs); struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node); struct task_struct *fork_idle(int); -extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); +extern pid_t kernel_thread(int (*fn)(void *), void *arg, const char *name, + unsigned long flags); extern pid_t user_mode_thread(int (*fn)(void *), void *arg, unsigned long flags); extern long kernel_wait4(pid_t, int __user *, int, struct rusage *); int kernel_wait(pid_t pid, int *stat); |