1SEM_POST(3)                Linux Programmer's Manual               SEM_POST(3)
2
3
4

NAME

6       sem_post - unlock a semaphore
7

SYNOPSIS

9       #include <semaphore.h>
10
11       int sem_post(sem_t *sem);
12

DESCRIPTION

14       sem_post()  increments  (unlocks)  the semaphore pointed to by sem.  If
15       the semaphore's value consequently  becomes  greater  than  zero,  then
16       another  process  or thread blocked in a sem_wait(3) call will be woken
17       up and proceed to lock the semaphore.
18

RETURN VALUE

20       sem_post() returns 0 on success; on error, the value of  the  semaphore
21       is  left  unchanged,  -1  is returned, and errno is set to indicate the
22       error.
23

ERRORS

25       EINVAL sem is not a valid semaphore.
26

CONFORMING TO

28       POSIX.1-2001.
29

NOTES

31       sem_post() is async-signal-safe: it may be safely called within a  sig‐
32       nal handler.
33

SEE ALSO

35       sem_getvalue(3), sem_wait(3), sem_overview(7)
36
37
38
39Linux 2.6.16                      2006-03-25                       SEM_POST(3)
Impressum