*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> sem_post (3)              
Title
Content
Arch
Section
 

SEM_POST(3)

Contents


NAME    [Toc]    [Back]

     sem_post - increment (unlock) a semaphore

SYNOPSIS    [Toc]    [Back]

     #include <semaphore.h>

     int
     sem_post(sem_t *sem);

DESCRIPTION    [Toc]    [Back]

     The sem_post() function increments (unlocks)  the  semaphore
pointed to by
     sem.   If  there  are  threads blocked on the semaphore when
sem_post() is
     called, then the  highest  priority  thread  that  has  been
blocked the
     longest  on  the  semaphore  will  be allowed to return from
sem_wait().

     sem_post() is signal-reentrant and may be called within signal handlers.

RETURN VALUES    [Toc]    [Back]

     The  sem_post()  function returns the value 0 if successful;
otherwise the
     value -1 is returned and the global variable errno is set to
indicate the
     error.

ERRORS    [Toc]    [Back]

     sem_post() will fail if:

     [EINVAL]      sem points to an invalid semaphore.

SEE ALSO    [Toc]    [Back]

      
      
     sem_trywait(3), sem_wait(3)

STANDARDS    [Toc]    [Back]

     sem_post() conforms to ISO/IEC 9945-1:1996 (``POSIX'').

OpenBSD      3.6                        February     15,     2000
[ Back ]
 Similar pages
Name OS Title
msem_unlock Tru64 Unlock a semaphore
msem_unlock HP-UX unlock a semaphore
sem_post HP-UX unlock a POSIX semaphore
incr IRIX Increment the value of a variable
VREF FreeBSD increment the use count for a vnode
vref OpenBSD increment the use count for a vnode
vref FreeBSD increment the use count for a vnode
DTinctime IRIX increment a DAT time code
XmScrollBarGetValues IRIX A ScrollBar function that returns the ScrollBar's increment values
XmScrollBarGetValues HP-UX A ScrollBar function that returns the ScrollBar's increment values
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service