2 .\" Hey Emacs! This file is -*- nroff -*- source.
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk-manpages@gmx.net>
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH SEM_POST 3 2006-03-25 "Linux 2.6.16" "Linux Programmer's Manual"
25 sem_post \- unlock a semaphore
28 .B #include <semaphore.h>
30 .BI "int sem_post(sem_t *" sem );
34 increments (unlocks) the semaphore pointed to by
36 If the semaphore's value consequently becomes greater than zero,
37 then another process or thread blocked in a
39 call will be woken up and proceed to lock the semaphore.
43 on error, the value of the semaphore is left unchanged,
46 is set to indicate the error.
51 is not a valid semaphore.
57 it may be safely called within a signal handler.