sem_unlink2
Remove a named semaphore
Usage
#include <semaphore.h>
int
sem_unlink(const char *name);
Overview
The named semaphore named name is removed. If the semaphore is in use by other processes, then name is immediately disassociated with the semaphore, but the semaphore itself will not be removed until all references to it have been closed. Subsequent calls to sem_open() using name will refer to or create a new semaphore named name.
If successful, sem_unlink() will return 0. Otherwise, -1 is returned and errno is set, and the state of the semaphore is unchanged.
Errors
sem_unlink() succeeds unless:
- [EACCES]
-
Permission is denied to be remove the semaphore.
- [ENAMETOOLONG]
-
name exceeded PSEMNAMLEN characters.
- [ENOENT]
-
The named semaphore does not exist.
Releases
161 releases since Mac OS X 10.0; the text changed 4 times.