2 .\" Hey Emacs! This file is -*- nroff -*- source.
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
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. 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
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
27 .\" Translated 2006-04-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .TH SEM_POST 3 2009-03-30 "Linux" "Linux Programmer's Manual"
32 .\"O sem_post \- unlock a semaphore
33 sem_post \- セマフォのロックを解除する
37 .B #include <semaphore.h>
39 .BI "int sem_post(sem_t *" sem );
42 .\"O Link with \fI\-lrt\fP or \fI\-pthread\fP.
43 \fI\-lrt\fP または \fI\-pthread\fP でリンクする。
47 .\"O increments (unlocks) the semaphore pointed to by
49 .\"O If the semaphore's value consequently becomes greater than zero,
50 .\"O then another process or thread blocked in a
52 .\"O call will be woken up and proceed to lock the semaphore.
56 が指すセマフォの値を 1 増やす (ロックを解除する)。その結果、
59 で停止している別のプロセスやスレッドが呼び起こされ、
64 .\"O returns 0 on success;
65 .\"O on error, the value of the semaphore is left unchanged,
66 .\"O \-1 is returned, and
68 .\"O is set to indicate the error.
71 は 0 を返す。エラーの場合、セマフォの値は変更せずに、 \-1 を返し、
79 .\"O is not a valid semaphore.
84 .\" Added in POSIX.1-2008 TC1 (Austin Interpretation 213)
85 .\"O The maximum allowable value for a semaphore would be exceeded.
86 一つのセマフォで使用できる最大値を超えてしまうところであった。
87 .\"O .SH CONFORMING TO
93 .\"O is async-signal-safe:
94 .\"O it may be safely called within a signal handler.
96 は async-signal-safe である。
97 つまり、シグナルハンドラの中でも安全に呼び出すことができる。
101 .\"O .BR sem_wait (3).
106 .BR sem_getvalue (3),