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

  man pages->HP-UX 11i man pages -> sem_destroy (2)              
Title
Content
Arch
Section
 

Contents


 sem_destroy(2)                                               sem_destroy(2)




 NAME    [Toc]    [Back]
      sem_destroy - destroy an unnamed POSIX semaphore

 SYNOPSIS    [Toc]    [Back]
      #include <sys/semaphore.h>

      int sem_destroy(sem_t *sem);

 DESCRIPTION    [Toc]    [Back]
      sem_destroy() is used to destroy an unnamed semaphore.  A successful
      call to sem_destroy() will invalidate the unnamed semaphore referred
      to by sem and removes all descriptors referencing it.  The semaphore
      should have been created by a previous call to sem_init() and there
      should not be any processes blocked on it.

      To use this function, link in the realtime library by specifying -lrt
      on the compiler or linker command line.

 EXAMPLES    [Toc]    [Back]
      The following call to sem_destroy() will destroy an unnamed semaphore
      referred to by sem and remove all descriptors referencing it.

           sem_destroy(sem);

 RETURN VALUE    [Toc]    [Back]
      If the semaphore was destroyed and the descriptors referencing it were
      removed, sem_destroy() returns 0 to the caller.

      If the semaphore could not be destroyed, the call returns -1 and sets
      errno to indicate the error.

 ERRORS    [Toc]    [Back]
      sem_destroy() fails and does not perform the requested operation if
      any of the following conditions are encountered:

           [EBUSY]        There are threads currently blocked on the
                          semaphore or there are outstanding locks held on
                          the semaphore.

           [EINVAL]       The argument sem is not a valid unnamed semaphore.

 SEE ALSO    [Toc]    [Back]
      sem_init(2), sem_open(2), <semaphore.h>.

 STANDARDS CONFORMANCE    [Toc]    [Back]
      sem_destroy(): POSIX


 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003
[ Back ]
      
      
 Similar pages
Name OS Title
sem_destroy OpenBSD destroy an unnamed semaphore
sem_destroy FreeBSD destroy an 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_init IRIX initialize a posix unnamed semaphore
sem_mode IRIX set the operation mode of a POSIX unnamed semaphore
sem_wait IRIX acquire a posix named or unnamed semaphore
sem_post IRIX release a posix named or unnamed semaphore
pipcrm HP-UX remove a POSIX message queue or a POSIX named semaphore
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service