sem_unlink¶
Synopsis¶
#include <semaphore.h>
int sem_unlink(const char *name);
Status¶
Implemented
Conformance¶
IEEE Std 1003.1-2024
Description¶
The sem_unlink() function shall remove the semaphore named by name.
The name is removed immediately, so a subsequent sem_open() without O_CREAT fails and one
with O_CREAT creates a new semaphore. Processes that already hold the semaphore open may
keep using it; the semaphore itself is destroyed once the last sem_close() returns.
Return value¶
Upon successful completion, sem_unlink() shall return 0. Otherwise it shall return -1,
the named semaphore shall be unchanged, and errno shall be set to indicate the error.
Errors¶
This function shall fail if:
EINVAL- name is a null pointer or is not a valid semaphore name,ENAMETOOLONG- the length of name exceedsNAME_MAX,ENOENT- the named semaphore does not exist.
POSIX deviations¶
No POSIX deviations discovered.