[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    sem_destroy(3R) manual page Table of Contents

Name

sem_destroy - destroy an unnamed semaphore

Synopsis

cc [ flag ... ] file ... -lposix4 [ library ... ]

#include <semaphore.h>

int sem_destroy(sem_t *sem);

typedef struct {
   ...

} sem_t; /*opaque POSIX.4 semaphore*/

MT-Level

MT-Safe

Description

sem_destroy() is used to destroy the unnamed semaphore, sem, which was initialized by sem_init(3R) .

Return Values

If successful, sem_destroy() returns 0, otherwise it returns -1 and sets errno to indicate the error condition.

Errors

EINVAL
sem is not a valid semaphore.
ENOSYS
sem_destroy() is not supported by this implementation.
EBUSY
Other processes (or LWPs or threads) are currently blocked on the semaphore.

See Also

sem_init(3R) , sem_open(3R)

Bugs

In Solaris 2.5, these functions always return -1 and set errno to ENOSYS, because this release does not support the Semaphores option. It is our intention to provide support for these interfaces in future releases.


Table of Contents