> hi, in linux I can do following:
> 
> tid = syscall(SYS_gettid);
> 
> to get the thread id of the current thread.
> 
> How do I do this in solaris?
> 

Why are you using syscall level facilities for threads instead of
POSIX (pthread_*())?  If you were, AFAIK pthread_self(3c) would be the
answer.

Otherwise, see _lwp_self(2); but I doubt very much that's committed,
in which case, it could be broken by some future update.  Ditto for
syscall(SYS_lwp_self), which should amount to the same thing, I think.

Besides, details of  threading mechanisms other than POSIX threads are
likely to vary between OSs in more than just this one way; so this isn't
the only problem you may have porting your code.
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to