diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2024-02-12 01:26:34 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-02-12 18:52:21 +0100 |
commit | 10b25803ce879ee6ac832b884bfdabc79769486a (patch) | |
tree | 75aa37ab8f0f8ed3ae2e7009027329cf6937df29 /kern/thread.h | |
parent | df9270ef134498d4fffb921286375137d3639ae5 (diff) | |
download | gnumach-10b25803ce879ee6ac832b884bfdabc79769486a.tar.gz gnumach-10b25803ce879ee6ac832b884bfdabc79769486a.tar.bz2 gnumach-10b25803ce879ee6ac832b884bfdabc79769486a.zip |
Add thread_set_name RPC.
Like task_set_name, we use the same size as the task name and will
inherit the task name, whenever it exists. This will be used to
implement pthread_setname_np.
Message-ID: <20240212062634.1082207-2-flaviocruz@gmail.com>
Diffstat (limited to 'kern/thread.h')
-rw-r--r-- | kern/thread.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kern/thread.h b/kern/thread.h index 7bfe2e89..21b25030 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -54,6 +54,12 @@ #include <machine/thread.h> #include <ipc/ipc_kmsg_queue.h> +/* + * Thread name buffer size. Use the same size as the task so + * the thread can inherit the task's name. + */ +#define THREAD_NAME_SIZE TASK_NAME_SIZE + struct thread { /* Run queues */ queue_chain_t links; /* current run queue links */ @@ -232,6 +238,8 @@ struct thread { #if MACH_LOCK_MON unsigned lock_stack; #endif + + char name[THREAD_NAME_SIZE]; }; #include <kern/cpu_number.h> |