pthread_getunique_np Subroutine
Purpose
Returns the sequence number of a thread.
Library
Threads Library (libpthreads.a)
Syntax
Description
The pthread_getunique_np subroutine returns the sequence number of the thread thread. The sequence number is a number, unique to each thread, which is associated with the thread at creation time.
Note:
- The pthread.h header file must be the first included file of each source
file by using the threads library. Otherwise, the
-D_THREAD_SAFEcompilation flag must be used, or the cc_r compiler used. In this case, the flag is automatically set. - The pthread_getunique_np subroutine is not portable.
This subroutine is not POSIX compliant and is provided only for compatibility with DCE threads. It must not be used when writing new applications.
Parameters
| Item | Description |
|---|---|
| thread | Specifies the thread. |
| sequence | Points to where the sequence number is stored. |
Return Values
Upon successful completion, the sequence number is returned via the sequence parameter, and 0 is returned. Otherwise, an error code is returned.
Error Codes
The pthread_getunique_np subroutine is unsuccessful if the following is true:
| Item | Description |
|---|---|
EINVAL |
The thread or sequence parameters are not valid. |
ESRCH |
The thread thread does not exist. |