|
|
HP-UX Reference > Ssem_destroy(2)HP-UX 11i Version 2: December 2007 Update |
|
NAMEsem_destroy() — destroy an unnamed POSIX semaphore DESCRIPTIONsem_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. EXAMPLESThe following call to sem_destroy() will destroy an unnamed semaphore referred to by sem and remove all descriptors referencing it. sem_destroy(sem); RETURN VALUEIf 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. |
|