sem_unlock(3P4)
NAME
sem_unlock − unlock a counting semaphore
SYNOPSIS
#include <semaphore.h>
int sem_unlock(sem)
sem_t ∗sem;
DESCRIPTION
The sem_unlock function unlocks the counting semaphore referenced by sem. If one or more processes are blocked on this semaphore, then the highest priority process that is currently blocked on the semaphore is unblocked.
RETURN VALUE
Upon successful completion, the sem_unlock function returns a zero. If any of the following conditions occur, the sem_unlock function will return -1 and set errno to the corresponding value:
[EINVAL] The argument sem does not refer to a valid counting semaphore.
FILES
/usr/lib/libposix4.a
SEE ALSO
sem_destroy(3P4), sem_unlink(3P4), sem_init(3P4), sem_lock(3P4), sem_trylock(3P4).
WARNING
The interface to sem_unlock is based on IEEE Draft Standard P1003.4/D12. This is an unapproved draft, subject to change. Use of information contained in this unapproved draft is at your own risk. This interface will change to reflect any changes made by future drafts of POSIX 1003.4.
CX/UX Programmer’s Reference Manual