SYNOPSIS
#include <semaphore.h>
int sem_wait(sem_t *sem);
int sem_trywait(sem_t *sem);
DESCRIPTION
The
The
Upon successful return, the state of the semaphore is locked and remains
locked until the
The delivery of a signal can interrupt the
PARAMETERS
RETURN VALUES
When the
- EAGAIN
-
The semaphore was already locked, so it cannot be immediately locked by the
sem_trywait() operation (sem_trywait() only). - EINTR
-
A signal interrupted this function.
The sem argument does not refer to a valid semaphore.
EXAMPLES
None.
CONFORMANCE
UNIX 03. Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
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
- Functions:
sem_post() ,semctl() ,semget() ,semop()
- Miscellaneous:
- semaphores
PTC MKS Toolkit 10.4 Documentation Build 39.