From 0f61ccea2876bc7cdffafe6f52555f5208d36d5b Mon Sep 17 00:00:00 2001 From: Robert Love Date: Tue, 8 Oct 2002 23:06:56 -0700 Subject: [PATCH] getpid() comment typo Comment above getpid() is wrong. This patch fixes it, and expands the comment to explain why on earth we have getpid() returning ->tgid and not ->pid. --- kernel/timer.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'kernel') 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; } -- cgit v1.2.3