public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] getpid() comment typo
@ 2002-10-08  1:53 Robert Love
  0 siblings, 0 replies; only message in thread
From: Robert Love @ 2002-10-08  1:53 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Linus,

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.

Patch is against 2.5.41, por favor, mi mejor pingüino, se aplica.

	Robert Love

diff -urN linux-2.5.41/kernel/timer.c linux/kernel/timer.c
--- linux-2.5.41/kernel/timer.c	2002-10-07 14:24:00.000000000 -0400
+++ linux/kernel/timer.c	2002-10-07 21:37:28.000000000 -0400
@@ -798,10 +798,18 @@
  * 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;
 }
 




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-08  1:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-08  1:53 [PATCH] getpid() comment typo Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox