int sem_wait( sem_t *sem );
This function attempts to lock a semaphore specified by sem
. If the
semaphore is available, then the semaphore is locked (i.e., the semaphore
value is decremented). If the semaphore is unavailable (i.e., the semaphore
value is zero), then the function will block until the semaphore becomes
available. It will then successfully lock the semaphore. The semaphore
remains locked until released by a sem_post()
call.
If the call is unsuccessful, then the function returns -1 and sets errno to the appropriate error code.
Multiprocessing is not supported in this implementation.
Copyright © 1988-2007OAR Corporation