PTHREAD_GETCPUCLOCKID(3)

NAME
pthread_getcpuclockid - retrieve the current thread's CPU-time clock

SYNOPSIS
cc [ flag ... ] file -lrt [ library ... ]

#include <time.h>

int pthread_getcpuclockid(pthread_t thread_id, clockid_t *clock_id);

DESCRIPTION
pthread_getcpuclockid retrieves the clock value of the CPU-time clock of the current thread. The clock value is stored in clock_id. The pthread ID specified by pthread_id must equal the current thread.

RETURN VALUE
On success, pthread_getcpuclockid returns the value 0 and places the retrieved clock value in clock_id.

On failure, pthread_getcpuclockid returns the value -1 and errno is set appropriately.

ERRORS

EFAULT
    A specified memory address is outside the address range of the calling process.

ENOSYS
    The function is not supported on this implementation.

EPERM
    The requesting thread is not pthread_id.

CONFORMING TO
POSIX 1003.1b (formerly POSIX.4) as ammended by POSIX 1003.1j-2000.

SEE ALSO
clock_getcpuclockid(3), clock_getres(3), clock_gettime(3), clock_nanosleep(3), timer_create(3), timer_delete(3), timer_settime(3), timer_gettime(3)

IEEE 1003.1b-1993 (POSIX.1b standard, formerly POSIX.4), Section 14 (Clocks and Timers).