Commit 0f61ccea authored by Robert Love's avatar Robert Love Committed by James Simmons

[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.
parent 2a7a183f
......@@ -799,9 +799,17 @@ asmlinkage unsigned long sys_alarm(unsigned int seconds)
* 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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment