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

  man pages->Tru64 Unix man pages -> sem_destroy (3)              
Title
Content
Arch
Section
 

sem_destroy(3)

Contents


NAME    [Toc]    [Back]

       sem_destroy - Destroys an unnamed semaphore (P1003.1b)

SYNOPSIS    [Toc]    [Back]

       #include <semaphore.h>

       int sem_destroy ( sem_t *sem);


LIBRARY    [Toc]    [Back]

       Realtime Library (librt.so, librt.a)

PARAMETERS    [Toc]    [Back]

       References  the unnamed semaphore to be destroyed. Use the
       sem argument that was supplied to, and filled in  by,  the
       previous call to sem_init.

DESCRIPTION    [Toc]    [Back]

       The  sem_destroy  function  destroys  an unnamed semaphore
       indicated by sem.  Only a semaphore created using sem_init
       may be destroyed using sem_destroy.

       The  potential  for  deadlock  exists  if  a process calls
       sem_destroy for a  semaphore  while  there  is  a  pending
       sem_wait,  because  a  process may be waiting for a poster
       that has not yet opened the semaphore.

RETURN VALUES    [Toc]    [Back]

       On successful completion, the function returns the value 0
       (zero);  otherwise,  the function returns the value -1 and
       sets errno to indicate the error, without  destroying  the
       semaphore indicated by the sem argument.

ERRORS    [Toc]    [Back]

       The  sem_destroy function fails under the following condition:
 The sem argument is not a valid semaphore.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: sem_init(3), sem_open(3)

       Guide to Realtime Programming



                                                   sem_destroy(3)
[ Back ]
 Similar pages
Name OS Title
sem_init Tru64 Initializes an unnamed semaphore (P1003.1b)
sem_init FreeBSD initialize an unnamed semaphore
sem_init OpenBSD initialize an unnamed semaphore
sem_destroy OpenBSD destroy an unnamed semaphore
sem_destroy FreeBSD destroy an unnamed semaphore
sem_init IRIX initialize a posix unnamed semaphore
sem_getvalue IRIX get the value of a posix named or unnamed semaphore
sem_destroy IRIX deinitialize a posix unnamed semaphore
sem_init HP-UX initialize an unnamed POSIX semaphore
sem_destroy HP-UX destroy an unnamed POSIX semaphore
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service