posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_CLOCK_SELECTION

POSIX Clock Selection option group. More...

Functions

int clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp)
 High-resolution sleep against a specified clock.
 
int pthread_cond_clockwait (pthread_cond_t *ZRESTRICT cond, pthread_mutex_t *ZRESTRICT mutex, clockid_t clock_id, const struct timespec *ZRESTRICT abstime)
 Wait on a condition variable with a specific clock.
 

Detailed Description

POSIX Clock Selection option group.

Function Documentation

◆ clock_nanosleep()

int clock_nanosleep ( clockid_t  clock_id,
int  flags,
const struct timespec rqtp,
struct timespec rmtp 
)

High-resolution sleep against a specified clock.

Parameters
clock_idClock to measure the sleep against.
flags0 for a relative sleep, TIMER_ABSTIME for an absolute wakeup time.
rqtpRequested sleep duration or absolute wakeup time.
rmtpOutput: remaining time if interrupted (only for relative sleeps), or NULL.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html

◆ pthread_cond_clockwait()

int pthread_cond_clockwait ( pthread_cond_t *ZRESTRICT  cond,
pthread_mutex_t *ZRESTRICT  mutex,
clockid_t  clock_id,
const struct timespec *ZRESTRICT  abstime 
)

Wait on a condition variable with a specific clock.

Parameters
condCondition variable.
mutexAssociated mutex (must be locked by the caller).
clock_idClock used to interpret abstime.
abstimeAbsolute timeout.
Returns
0 on success, ETIMEDOUT on timeout, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_clockwait.html