* [PATCH] 2.4: get_pid() typo fix
@ 2002-10-06 19:44 Robert Love
2002-10-07 13:40 ` Denis Vlasenko
0 siblings, 1 reply; 2+ messages in thread
From: Robert Love @ 2002-10-06 19:44 UTC (permalink / raw)
To: marcelo; +Cc: linux-kernel
Magnificent Marcelo,
Fix a typo in the comment of getpid() - we return current->tgid these
days, not current->pid. Additionally, add some new comments explaining
exactly why we return the tgid and how this works.
Patch is against 2.4.20-pre9, please apply.
Robert Love
diff -urN linux-2.4.20-pre9/kernel/timer.c linux/kernel/timer.c
--- linux-2.4.20-pre9/kernel/timer.c 2002-10-06 14:57:20.000000000 -0400
+++ linux/kernel/timer.c 2002-10-06 15:03:31.000000000 -0400
@@ -740,10 +740,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] 2+ messages in thread
* Re: [PATCH] 2.4: get_pid() typo fix
2002-10-06 19:44 [PATCH] 2.4: get_pid() typo fix Robert Love
@ 2002-10-07 13:40 ` Denis Vlasenko
0 siblings, 0 replies; 2+ messages in thread
From: Denis Vlasenko @ 2002-10-07 13:40 UTC (permalink / raw)
To: Robert Love, marcelo; +Cc: linux-kernel
On 6 October 2002 17:44, Robert Love wrote:
> Magnificent Marcelo,
^^^^^^^^^^^
Is this affects probability of patch being accepted?
If yes, which is the best? ;-)
--
vda
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-10-07 8:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06 19:44 [PATCH] 2.4: get_pid() typo fix Robert Love
2002-10-07 13:40 ` Denis Vlasenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).