Quote Originally Posted by Shining Arcanine View Post
You probably have never programmed on Linux. The kernel supports gettid(), but gettid() is not available in userland. It is something that makes threaded programming a pain on Linux and it also introduces unnecessary issues when porting software to Linux.


With that said, I would like to ask that you refrain from making such ignorant comments, or better yet, that you use Windows. Software developers don't have time to deal with this nonsense.
I must have completely misunderstood your post / OP, but pthread_self returns the current thread ID.
Beyond that, as far as I can see gettid is exported to usermode (by using syscall(SYS_gettid)).
Did I miss anything?

- Gilboa