Destroy a named semaphore
#include <semaphore.h> int sem_unlink( const char * sem_name );
- The name of the semaphore that you want to destroy.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The sem_unlink() function destroys the named semaphore, sem_name. Open semaphores are removed the same way that unlink() removes open files; the processes that have the semaphore open can still use it, but the semaphore will disappear as soon as the last process uses sem_close() to close it.
Any attempt to use sem_open() on an unlinked semaphore will refer to a new semaphore.
Semaphores are persistent as long as the system remains up.
- An error occurred (errno is set).
- You don't have permission to unlink the semaphore.
- Too many levels of symbolic links or prefixes.
- The semaphore sem_name doesn't exist.
- The sem_name argument is longer than (NAME_MAX - 8).
- The sem_unlink() function isn't implemented for the filesystem specified in path.
Last modified: 2013-09-30