diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-11-16 19:22:19 -0800 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2002-11-16 19:22:19 -0800 |
| commit | 5c72e21034b59fd8208dadfe414bdb1688ee8765 (patch) | |
| tree | 3522ddbd7d3e07665295ed0751b62ef33a1e1e55 | |
| parent | 4a539f1c62c6a5ba63b93323b23bfc6f10937586 (diff) | |
[PATCH] threading fix, tid-2.5.47-A3
This introduces the sys_set_thread_address() syscall. It sets the tid
address (which gets cleared at VM release time) and returns the PID so
that the newly initialized 'initial thread' does not have to do an
additional sys_gettid() call.
It is used to bootstrap a thread group where the original thread user
hasn't had a tid address assigned to it by any parent.
| -rw-r--r-- | arch/i386/kernel/entry.S | 1 | ||||
| -rw-r--r-- | kernel/fork.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index b0c2e80f59f1..512a6602f90b 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -767,6 +767,7 @@ ENTRY(sys_call_table) .long sys_epoll_ctl /* 255 */ .long sys_epoll_wait .long sys_remap_file_pages + .long sys_set_tid_address .rept NR_syscalls-(.-sys_call_table)/4 diff --git a/kernel/fork.c b/kernel/fork.c index a9f8eb192f9a..accc05f2fef5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -679,6 +679,13 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p) p->flags = new_flags; } +asmlinkage int sys_set_tid_address(int *user_tid) +{ + current->user_tid = user_tid; + + return current->pid; +} + /* * This creates a new process as a copy of the old one, * but does not actually start it yet. |
