Skip to contentSkip to conversation

getpid() comment typo

PATCH New Robert Love 1 participant 1 message Oct 8, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getpid() comment typo

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

kernel/timer.c +10 -2
diff -urN linux-2.5.41/kernel/timer.c linux/kernel/timer.c
@@ -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;
 }