Please check the manual page sem_wait(3).