Wait on a named or unnamed semaphore
#include <semaphore.h> int sem_wait( sem_t * sem );
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The sem_wait() function decrements the semaphore referred to by the sem argument. If the semaphore value is not greater than zero, then the calling process blocks until it can decrement the counter, or the call is interrupted by signal.
Some process should eventually call sem_post() to increment the semaphore.
POSIX 1003.1 SEM
sem_destroy(), sem_init(), sem_post(), sem_trywait()