Re: same pid ?
ratheesh k <[email protected]> Thu, 10 Feb 2011 23:39:01 +0530
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
2011/2/10 Michal Nazarewicz <[email protected]>: > On Thu, 10 Feb 2011 12:37:25 +0100, ratheesh k <[email protected]> > wrote: >> >> i created two threads with pthread library. But both threads returns >> same pid with getpid() function. ??? > > PID is a Process ID. All threads in given process have the same PID. > pthread uses clone system call. doen't it ? if so, please see - man clone CLONE_PID (obsolete) If CLONE_PID is set, the child process is created with the same process ID as the calling process. This is good for hacking the system, but otherwise of not much use. Since 2.3.21 this flag can be specified only by the system boot process (PID 0). It disappeared in Linux 2.5.16. > -- > Best regards, _ _ > .o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o > ..o | Computer Science, Michal "mina86" Nazarewicz (o o) > ooo +-<email/jid: [email protected]>--------ooO--(_)--Ooo-- > -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html