From 5c72e21034b59fd8208dadfe414bdb1688ee8765 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 16 Nov 2002 19:22:19 -0800 Subject: [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. --- kernel/fork.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kernel') 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. -- cgit v1.2.3