Returns the calling thread's ID.
Threads Library (libpthreads.a)
#include <pthread.h>
pthread_t pthread_self (void);
The pthread_self subroutine returns the calling thread's ID.
The calling thread's ID is returned.
No errors are defined.
The pthread_self function will not return an error code of EINTR.