Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

msem_init(3)

msem_lock(3)

msem_unlock(3)

munmap(2)

MSEM_REMOVE(3)                       SysV                       MSEM_REMOVE(3)



NAME
     msem_remove - Remove a semaphore

SYNOPSIS
     #include <sys/mman.h>

     int msem_remove (sem)
     msemaphore *sem;

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(3) function will have undefined results.

     The sem argument points to an msemaphore structure which specifies the
     semaphore to be removed.

     The msem_remove function also causes any process waiting in the
     msem_lock(3) 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(3) function followed by a (possibly empty) sequence of
     calls to the msem_lock(3) and msem_unlock(3) 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.

DIAGNOSTICS
     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
     msem_remove fails if:

     [EINVAL]       The sem argument points to an msemaphore structure which
                    specifies a semaphore which has been removed.

SEE ALSO
     msem_init(3), msem_lock(3), msem_unlock(3), munmap(2), <sys/mman.h>

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026