PTHREAD_GETCPUCLOCKID(3)

PTHREAD_GETCPUCLOCKID(3) | Library Functions Manual | PTHREAD_GETCPUCLOCKID(3)

# NAME

`pthread_getcpuclockid` —
retrieve the clockid of the given thread

# LIBRARY

Standard C Library (libc, -lc)

# SYNOPSIS

`#include <pthread.h>`

int
`pthread_getcpuclockid`(pthread_t thread, clockid_t *clock_id);

# DESCRIPTION

The `pthread_getcpuclockid`() function retrieves the clock_id for the specified thread.

The clock_gettime(2) function can be used with the returned clock_id to retrieve LWP times.

# RETURN VALUES

On success the `pthread_getcpuclockid`() function returns 0, placing the requested clock_id in the argument. Otherwise an error number will be returned.

# ERRORS

These functions fail if:

[`EFAULT`]
  clock_id points outside the process's allocated address space.

# SEE ALSO

clock_getcpuclockid2(2), clock_gettime(2)

# STANDARDS

The `pthread_getcpuclockid`() function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). extension.

# HISTORY

The `pthread_getcpuclockid`() function appeared in NetBSD 8.

March 5, 2017 | NetBSD 9.5