Accesses a thread CPU-time clock.
#include <pthread.h>
#include <time.h>
int pthread_getcpuclockid(pthread_t thread_id, clockid_t *clock_id);
The pthread_getcpuclockid subroutine returns in the clock_id parameter the clock ID of the CPU-time clock of the thread specified by thread_id, if the thread specified by thread_id exists.
Item | Description |
---|---|
thread_id | Specifies the ID of the pthread whose clock ID is requested. |
clock_id | Points to the clockid_t structure used to return the thread CPU-time clock ID of thread_id. |
Upon successful completion, the pthread_getcpuclockid subroutine returns 0; otherwise, an error number is returned to indicate the error.
Item | Description |
---|---|
ENOTSUP | The subroutine is not supported with checkpoint-restart'ed processes. |
ESRCH | The value specified by thread_id does not refer to an existing thread. |