summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorRobert Love <rml@tech9.net>2002-10-08 23:06:56 -0700
committerJames Simmons <jsimmons@maxwell.earthlink.net>2002-10-08 23:06:56 -0700
commit0f61ccea2876bc7cdffafe6f52555f5208d36d5b (patch)
tree52335e0768ca7f8d18bfae3d7adaed20a8c32dd7 /kernel
parent2a7a183fba201c2827328f786e2980cf11cc79a6 (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.c12
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;
}