pthread_getcpuclockid

pthread_getcpuclockid()

access a thread CPU-time clock 

Advanced Realtime Threads


SYNOPSIS

#include <pthread.h>

#include <time.h>

int pthread_getcpuclockid(pthread_t thread_id, clockid_t *clock_id);


DESCRIPTION

The pthread_getcpuclockid() function retrieves the clock ID of the CPU-time clock associated with specified thread ID (thread_id) and stores in the location pointed to by clock_id.

On the NuTCRACKER Platform, thread_id can only be the thread ID of the current thread. As a result, the clock ID retrieved is always CLOCK_THREAD_CPUTIME_ID. This clock ID can only be used clock_gettime() or clock_getres().


PARAMETERS

clock_id 

Points to a location where the retrieved clock ID is to be stored.

thread_id 

Points to a thread ID.


RETURN VALUES

On success, pthread_getcpuclockid() returns 0.

Otherwise, it returns one of the following:

EFAULT 

The clock_id pointer points to an unwritable location.

ENOSYS 

The system does not support this function.

ENOTSUP 

The specified thread ID (thread_id) is not that of the current thread.


CONFORMANCE

UNIX 03.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

The NuTCRACKER Platform implements this function using the Win32 GetThreadTimes() API.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

api_intro

Functions:
clock_getcpuclockid(), clock_getres(), timer_create()


PTC MKS Toolkit 10.4 Documentation Build 39.