]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sem_post.3
Add fixme
[thirdparty/man-pages.git] / man3 / sem_post.3
CommitLineData
2c731798
MK
1'\" t
2.\" Hey Emacs! This file is -*- nroff -*- source.
3.\"
c11b1abf 4.\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
2c731798
MK
5.\"
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.
9.\"
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.
c13182ef 14.\"
2c731798
MK
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
10d76543
MK
18.\" the use of the information contained herein. The author(s) may not
19.\" have taken the same level of care in the production of this manual,
20.\" which is licensed free of charge, as they might when working
21.\" professionally.
c13182ef 22.\"
2c731798
MK
23.\" Formatted or processed versions of this manual, if unaccompanied by
24.\" the source, must acknowledge the copyright and authors of this work.
25.\"
d9343c5c 26.TH SEM_POST 3 2006-03-25 "Linux" "Linux Programmer's Manual"
2c731798
MK
27.SH NAME
28sem_post \- unlock a semaphore
29.SH SYNOPSIS
30.nf
31.B #include <semaphore.h>
32.sp
33.BI "int sem_post(sem_t *" sem );
34.fi
fce1dd17
MK
35.sp
36Link with \fI\-lrt\fP or \fI\-pthread\fP.
2c731798
MK
37.SH DESCRIPTION
38.BR sem_post ()
39increments (unlocks) the semaphore pointed to by
40.IR sem .
41If the semaphore's value consequently becomes greater than zero,
c13182ef 42then another process or thread blocked in a
2c731798
MK
43.BR sem_wait (3)
44call will be woken up and proceed to lock the semaphore.
45.SH RETURN VALUE
46.BR sem_post ()
c13182ef 47returns 0 on success;
2c731798
MK
48on error, the value of the semaphore is left unchanged,
49\-1 is returned, and
c13182ef 50.I errno
2c731798
MK
51is set to indicate the error.
52.SH ERRORS
53.TP
54.B EINVAL
55.I sem
56is not a valid semaphore.
57.SH CONFORMING TO
58POSIX.1-2001.
59.SH NOTES
60.BR sem_post ()
61is async-signal-safe:
62it may be safely called within a signal handler.
63.SH "SEE ALSO"
64.BR sem_getvalue (3),
65.BR sem_wait (3),
66.BR sem_overview (7)