diff options
| author | Robert Love <rml@tech9.net> | 2002-10-08 23:06:56 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-10-08 23:06:56 -0700 |
| commit | 0f61ccea2876bc7cdffafe6f52555f5208d36d5b (patch) | |
| tree | 52335e0768ca7f8d18bfae3d7adaed20a8c32dd7 /kernel | |
| parent | 2a7a183fba201c2827328f786e2980cf11cc79a6 (diff) | |
[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.
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; } |
