sem_destroy3
Destroy an unnamed semaphore
Usage
#include <semaphore.h>
int
sem_destroy(sem_t *sem);
Library
Standard C Library (libc, -lc)
Overview
The sem_destroy() function destroys the unnamed semaphore pointed to by sem. After a successful call to sem_destroy(), sem is unusable until re-initialized by another call to sem_init(3).
Return values
The sem_destroy() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
Errors
The sem_destroy() function will fail if:
- [EINVAL]
-
The sem argument points to an invalid semaphore.
- [EBUSY]
-
There are currently threads blocked on the semaphore that sem points to.
Releases
70 releases since FreeBSD 4.0-RELEASE; the text changed 40 times.