diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/timer.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index bdd8df9e1691..16840a689ba4 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -798,10 +798,18 @@ asmlinkage unsigned long sys_alarm(unsigned int seconds) * The Alpha uses getxpid, getxuid, and getxgid instead. Maybe this * should be moved into arch/i386 instead? */ - + +/** + * sys_getpid - return the thread group id of the current process + * + * Note, despite the name, this returns the tgid not the pid. The tgid and + * the pid are identical unless CLONE_THREAD was specified on clone() in + * which case the tgid is the same in all threads of the same group. + * + * This is SMP safe as current->tgid does not change. + */ asmlinkage long sys_getpid(void) { - /* This is SMP safe - current->pid doesn't change */ return current->tgid; } |
