#include <sys/mman.h>
int msem_unlock (Sem, Condition) msemaphore *Sem; int Condition;
The msem_unlock subroutine attempts to unlock a binary semaphore.
If the semaphore is currently locked, it is unlocked and the msem_unlock subroutine completes successfully.
If the Condition parameter is 0, the semaphore is unlocked, regardless of whether or not any other processes are currently attempting to lock it. If the Condition parameter is set to the MSEM_IF_WAITERS value, and another process is waiting to lock the semaphore or it cannot be reliably determined whether some process is waiting to lock the semaphore, the semaphore is unlocked by the calling process. If the Condition parameter is set to the MSEM_IF_WAITERS value and no process is waiting to lock the semaphore, the semaphore will not be unlocked and an error will be returned.
When successful, the msem_unlock subroutine returns a value of 0. Otherwise, it returns a value of -1 and sets the errno global variable to indicate the error.
If the msem_unlock subroutine is unsuccessful, the errno global variable is set to one of the following values:
The msem_unlock subroutine is part of Base Operating System (BOS) Runtime.
The msem_init subroutine, msem_lock subroutine, msem_remove subroutine.
List of Memory Mapping Services and Understanding Memory Mapping in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.