MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Standard C Library Functions                      semdestroy(3C)



NAME
     semdestroy - destroy an unnamed semaphore

SYNOPSIS
     #include 

     int semdestroy(semt *sem);


DESCRIPTION
     The semdestroy() function is used to  destroy  the  unnamed
     semaphore  indicated  by  sem.  Only  a  semaphore  that was
     created  using   seminit(3C)   may   be   destroyed   using
     semdestroy();  the  effect  of calling semdestroy() with a
     named semaphore is undefined. The effect of  subsequent  use
     of   the  semaphore  sem  is  undefined  until  sem  is  re-
     initialized by another call to seminit(3C).


     It is safe to destroy an initialised semaphore upon which no
     threads  are  currently  blocked. The effect of destroying a
     semaphore upon which other threads  are currently blocked is
     undefined.

RETURN VALUES
     If successful, semdestroy() returns 0, otherwise it returns
     -1 and sets errno to indicate the error.

ERORS
     The  semdestroy() function will fail if:

     EINVAL     The sem argument is not a valid semaphore.



     The semdestroy() function may fail if:

     EBUSY     There are currently processes (or LWPs or threads)
               blocked on the semaphore.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:











SunOS 5.11           Last change: 5 Feb 2008                    1






Standard C Library Functions                      semdestroy(3C)



     
     ATRIBUTE TYPE               ATRIBUTE VALUE             
    
     Interface Stability          Committed                   
    
     MT-Level                     MT-Safe                     
    
     Standard                     See standards(5).           
    


SEE ALSO
     seminit(3C), semopen(3C), attributes(5), standards(5)










































SunOS 5.11           Last change: 5 Feb 2008                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™