Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > M


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


msem_remove — remove a semaphore in mapped file or anonymous region


#include <sys/mman.h>

int *msem_remove(msemaphore *sem);


msem_remove() removes a binary semaphore.

sem points to an msemaphore structure that specifies the semaphore to be removed. Any subsequent use of the msemaphore structure before it is again initialized by calling msem_init() produces undefined results.

msem_remove() 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 msem_init() followed by a (possibly empty) sequence of calls to msem_lock() and msem_unlock(), the results are undefined. The address of an msemaphore uniquely identifies the semaphore. If the msemaphore structure contains any value copied from a msemaphore structure at a different address, the result is undefined.


Upon success, msem_remove() returns zero; otherwise, it returns -1 and sets errno to indicate the error.


msem_remove() fails if any of the following conditions are encountered:


sem points to an msemaphore structure that has been removed.


sem is an invalid pointer.


msem_remove() was developed by HP and OSF.


msem_remove(): AES

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.