Xinu7/man/man2/wait.doc




WAIT(2)             Xinu Programmer's Manual              WAIT(2)



NAME
     wait - block and wait until semaphore signalled

SYNOPSIS
     int wait(sem)
     int sem;

DESCRIPTION
     _W_a_i_t decrements the count of semaphore _s_e_m, blocking the
     calling process if the count goes negative by enqueuing it
     in the queue for _s_e_m. The only ways to get free from a sema-
     phore queue are for some other process to signal the sema-
     phore, or for some other process to delete or reset the
     semaphore.  _W_a_i_t and SIGNAL(2) are the two basic synchroni-
     zation primitives in the system.

     _W_a_i_t returns SYSERR if _s_e_m is invalid.  Otherwise, it
     returns OK once freed from the queue.

SEE ALSO
     scount(2), screate(2), sdelete(2), signal(2), sreset(2)


































Version 6b               Printed 1/12/87                        1