pthread_getcpuclockid Subroutine

Purpose

Accesses a thread CPU-time clock.

Syntax

#include <pthread.h>
#include <time.h>

int pthread_getcpuclockid(pthread_t thread_id, clockid_t *clock_id); 

Description

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.

Parameters

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.

Return Values

Upon successful completion, the pthread_getcpuclockid subroutine returns 0; otherwise, an error number is returned to indicate the error.

Error Codes

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.