Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

msem_remove(3) [osf1 man page]

msem_remove(3)						     Library Functions Manual						    msem_remove(3)

NAME
msem_remove - Removes a semaphore LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <sys/mman.h> int msem_remove ( msemaphore *sem ); PARAMETERS
Points to an msemaphore structure which specifies the semaphore to be removed. DESCRIPTION
The msem_remove() function removes a binary semaphore. Any subsequent use of the msemaphore structure before it is again initialized by calling the msem_init() function will have undefined results. The msem_remove() function also causes any process waiting in the msem_lock() function on the removed semaphore to return with an error. If the msemaphore structure contains any value not resulting from a call to the msem_init() function followed by a (possibly empty) sequence of calls to the msem_lock() and msem_unlock() functions, the result is undefined. The address of an msemaphore structure may be significant. If the msemaphore structure contains any value copied from an msemaphore structure at a different address, the result is undefined. NOTES
Trial use RETURN VALUES
On successful completion, the msem_remove() function returns 0 (zero). On error, the msem_remove() function returns -1 and sets errno to indicate the error. ERRORS
If the msem_remove() function fails, errno may be set to the following value: The sem parameter points to an msemaphore structure which specifies a semaphore which has been removed. RELATED INFORMATION
Functions: msem_init(3), msem_lock(3), msem_unlock(3), munmap(2) delim off msem_remove(3)

Check Out this Related Man Page

msem_unlock(2)							System Calls Manual						    msem_unlock(2)

NAME
msem_unlock - unlock a semaphore SYNOPSIS
DESCRIPTION
unlocks a binary semaphore. sem points to an structure that specifies the semaphore to be unlocked. If the condition argument is zero, the semaphore will be unlocked, whether or not any other processes are currently attempting to lock it. If the condition argument is and some other process is waiting to lock the semaphore or the implementation cannot reliably determine whether some process is waiting to lock the semaphore, the semaphore is unlocked by the calling process. If the condition argument is and no process is waiting to lock the semaphore, the semaphore is not unlocked and an error is returned. All calls to and by multiple processes sharing a common structure behave as if the calls were serialized. If the structure contains any value not resulting from a call to followed by a (possibly empty) sequence of calls to and the results are undefined. The address of an uniquely identifies the semaphore. If the structure contains any value copied from a structure at a differ- ent address, the result is undefined. IMPLEMENTATION NOTES
The system attempts to ignore or recover from invalid values placed in the structure, but this is not guaranteed for all cases. RETURN VALUE
Upon success, returns zero; otherwise, it returns -1 and sets to indicate the error. ERRORS
fails if any of the following conditions are encountered: [EAGAIN] was specified and there were no waiters. [EINVAL] sem points to an structure that has been removed, or condition is invalid. [EFAULT] sem is an invalid pointer. AUTHOR
was developed by HP and OSF. SEE ALSO
msem_init(2), msem_lock(2), msem_remove(2), mman(5). STANDARDS CONFORMANCE
msem_unlock(2)
Man Page