gettid(2) - Linux man page
Name
gettid - get thread identificationSynopsis
#include <sys/types.h> pid_t gettid(void);Note: There is no glibc wrapper for this system call; see NOTES.
Description
Return Value
On success, returns the thread ID of the calling process.Errors
This call is always successful.Versions
The gettid() system call first appeared on Linux in kernel 2.4.11.Conforming to
gettid() is Linux-specific and should not be used in programs that are intended to be portable.Notes
Glibc does not provide a wrapper for this system call; call it using syscall(2).The thread ID returned by this call is not the same thing as a POSIX thread ID (i.e., the opaque value returned by pthread_self(3)).