man sem_timedwait () - lock a semaphore with a timeout
NAME
sem_timedwait - lock a semaphore with a timeout
SYNOPSIS
#include <semaphore.h> int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout);
DESCRIPTION
The sem_timedwait function locks the semaphore referenced by sem like sem_wait. If the semaphore is not locked at the time specified by the abs_timeout, sem_timedwait returns with the ETIMEDOUT error. The absolute timeout is expressed with respect to the CLOCK_REALTIME clock.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
All error values of sem_wait apply. In addition, the following errors defined.
- ETIMEDOUT
- The semaphore lock operation timed out.
AUTHOR
Michael Barabanov (baraban@fsmlabs.com (link to URL mailto:baraban@fsmlabs.com) )
SEE ALSO
sem_wait(3) (link to URL ../susv2/xsh/sem_wait.html) , clock_gettime(3) (link to URL ../susv2/xsh/clock_gettime.html)
©2001 FSMLabs Inc.
All rights reserved.