[RFC] Implement pthread_getthreadid_np(3) and pthread_getunique_np(3)

Kostik Belousov kostikbel at gmail.com
Fri Feb 4 21:33:08 UTC 2011


On Fri, Feb 04, 2011 at 02:09:10PM -0500, Jung-uk Kim wrote:
> Our pthread_t is not an integral type and it causes a lot of trouble 
> porting some software, which relies on Linux's gettid() or similar 
> syscalls:
> 
> http://www.kernel.org/doc/man-pages/online/pages/man2/gettid.2.html
> 
> For example:
> 
> http://docs.freebsd.org/cgi/mid.cgi?201102032111.13479.jkim
> 
> To solve this problem, I implemented two functions:
> 
> http://people.freebsd.org/~jkim/thr_tid.diff
> 
> Basically, they are AIX's pthread_getthreadid_np(3) and 
> pthread_getunique_np(3) look-alikes:
> 
> http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/users_22.htm
> http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/users_23.htm
> 
> Please let me know what you think.
Why do you need new functions available in stubs ?

Also, would it be better to return proper id even if threading is not
initialized, instead of EINVAL  ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20110204/7838130a/attachment.pgp


More information about the freebsd-threads mailing list