FC5: getpid in threads

Gilboa Davara gilboad at gmail.com
Tue Nov 21 22:12:09 UTC 2006


On Tue, 2006-11-21 at 10:08 -0800, Brian D. McGrew wrote:
> Hello,
> 
> In the FC3 day the following program, linked to /lib/libthread.so, when
> ran would return me three unique pid's, one for each thread.
> 
> In FC5, this does not seems to work.  /lib/libpthread.so is gone and I'm
> forced to use /lib/tls/libpthread.so and this code does not work; I get
> the same pid back for every thread, the pid of the main program.
> 
> I have several thousand lines of code which depend on a thread being
> able to get it's own unique pid.  How do I fix or work around this???

Use pthread_self (3) instead.

- Gilboa




More information about the users mailing list