public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug in sys_getpid() comment?
@ 2002-09-27  3:21 Shaya Potter
  2002-09-27  3:45 ` Robert Love
  0 siblings, 1 reply; 2+ messages in thread
From: Shaya Potter @ 2002-09-27  3:21 UTC (permalink / raw)
  To: linux-kernel

this is sys_getpid() on 2.4.19

asmlinkage long sys_getpid(void)
{
        /* This is SMP safe - current->pid doesn't change */
        return current->tgid;
}

I assume we are returning tgid so that no matter what thread of a
multithreaded program calls getpid we return the same value, and that
the comment with pid is old and should have been updated when it was
changed to return tgid.  A student in my Operating Systems class pointed
this out, so I figured no harm in pointing the possible bug out.

thanks,

shaya


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-27  3:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-27  3:21 bug in sys_getpid() comment? Shaya Potter
2002-09-27  3:45 ` Robert Love

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