PTHREAD_SELF(3) Library Functions Manual PTHREAD_SELF(3)

pthread_selfget the calling thread ID

#include <pthread.h>

pthread_t pthread_self(void);

The pthread_self () function shall return the thread ID of the calling thread.

The pthread_self () function shall always be successful and no return value is reserved to indicate an error.

No errors are defined.

None.

None.

The pthread_self () function provides a capability similar to the getpid(3) function for processes and the rationale is the same: the creation call does not provide the thread ID to the created thread.

None.

pthread_create(3), pthread_equal(3)

XBD <pthread.h>

First released in Issue 5. Included for alignment with the POSIX Threads Extension.

The pthread_self () function is marked as part of the Threads option.

Austin Group Interpretation 1003.1-2001 #063 is applied, updating the RETURN VALUE section.

The pthread_self () function is moved from the Threads option to the Base.

January 31, 2018 posix.fail