sem_destroy(2) hpux man page | unix.com

Man Page: sem_destroy

Operating Environment: hpux

Section: 2

sem_destroy(2)							System Calls Manual						    sem_destroy(2)

NAME
sem_destroy - destroy an unnamed POSIX semaphore
SYNOPSIS
DESCRIPTION
is used to destroy an unnamed semaphore. A successful call to will invalidate the unnamed semaphore referred to by sem and removes all descriptors referencing it. The semaphore should have been created by a previous call to and there should not be any processes blocked on it. To use this function, link in the realtime library by specifying on the compiler or linker command line.
EXAMPLES
The following call to will destroy an unnamed semaphore referred to by sem and remove all descriptors referencing it.
RETURN VALUE
If the semaphore was destroyed and the descriptors referencing it were removed, returns 0 to the caller. If the semaphore could not be destroyed, the call returns -1 and sets to indicate the error.
ERRORS
fails and does not perform the requested operation if any of the following conditions are encountered: [EBUSY] There are threads currently blocked on the semaphore or there are outstanding locks held on the semaphore. [EINVAL] The argument sem is not a valid unnamed semaphore.
SEE ALSO
sem_init(2), sem_open(2), <semaphore.h>.
STANDARDS CONFORMANCE
sem_destroy(2)
Related Man Pages
sem_destroy(3) - centos
sem_destroy(2) - hpux
sem_init(2) - hpux
sem_destroy(3) - freebsd
sem_destroy(3) - v7
Similar Topics in the Unix Linux Community
Example for use of kernel semaphore
semaphore concept
Symbol referencing error
how to clean Unused semaphore??
unnamed pipes and threads