psema man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



psema(D3X)							    psema(D3X)

NAME
     psema - perform a "P" or wait semaphore operation

SYNOPSIS
     #include "sys/types.h"
     #include "sys/param.h"
     #include "sys/sema.h"

     psema(sema_t *semap, int flags);

DESCRIPTION
     psema performs a "P" semaphore operation on the given semaphore.  The
     value associated with the semaphore is decremented by 1.  If the
     semaphore value then becomes less than 0, the process goes to sleep and
     gives up the CPU.

     Use semap to pass psema a pointer to the semaphore you want to decrement.
     Use flags to specify whether you want the process to be able to be woken
     by a signal if it ends up going to sleep.	A flag value of (flags &
     PMASK) > PZERO will make the process interruptible, otherwise it is not.
     The required symbolic constants are defined in param.h.  If the process
     is awakened by a signal, then the semaphore value is incremented and is
     allowed to continue.

     To initialize and allocate a semaphore, call initnsema or
     initnsema_mutex.

   Return Values
     psema returns -1 if a breakable sleep is interrupted by a signal.
     Otherwise psema returns 0.

   Note
     psema may cause the calling process to sleep; it must not be called from
     within an interrupt procedure.

SEE ALSO
     sleep(D3), SLEEP_LOCK(D3)

									Page 1

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net