OSDN Git Service

d98e3e55808729f7591fb4c1494966ccfb4baeb6
[linuxjm/LDP_man-pages.git] / draft / man3 / sem_post.3
1 '\" t
2 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\"
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
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.
14 .\"
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
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
27 .\" Translated 2006-04-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\"
29 .TH SEM_POST 3 2009-03-30 "Linux" "Linux Programmer's Manual"
30 .\"O .SH NAME
31 .SH 名前
32 .\"O sem_post \- unlock a semaphore
33 sem_post \- セマフォのロックを解除する
34 .\"O .SH SYNOPSIS
35 .SH 書式
36 .nf
37 .B #include <semaphore.h>
38 .sp
39 .BI "int sem_post(sem_t *" sem );
40 .fi
41 .sp
42 .\"O Link with \fI\-lrt\fP or \fI\-pthread\fP.
43 \fI\-lrt\fP または \fI\-pthread\fP でリンクする。
44 .\"O .SH DESCRIPTION
45 .SH 説明
46 .\"O .BR sem_post ()
47 .\"O increments (unlocks) the semaphore pointed to by
48 .\"O .IR sem .
49 .\"O If the semaphore's value consequently becomes greater than zero,
50 .\"O then another process or thread blocked in a
51 .\"O .BR sem_wait (3)
52 .\"O call will be woken up and proceed to lock the semaphore.
53 .BR sem_post ()
54 は、
55 .I sem
56 が指すセマフォの値を 1 増やす (ロックを解除する)。その結果、
57 セマフォの値は 0 より大きな値に変化し、
58 .BR sem_wait (3)
59 で停止している別のプロセスやスレッドが呼び起こされ、
60 セマフォをロックできるようになる。
61 .\"O .SH RETURN VALUE
62 .SH 返り値
63 .\"O .BR sem_post ()
64 .\"O returns 0 on success;
65 .\"O on error, the value of the semaphore is left unchanged,
66 .\"O \-1 is returned, and
67 .\"O .I errno
68 .\"O is set to indicate the error.
69 成功すると、
70 .BR sem_post ()
71 は 0 を返す。エラーの場合、セマフォの値は変更せずに、 \-1 を返し、
72 .I errno
73 にエラーを示す値をセットする。
74 .\"O .SH ERRORS
75 .SH エラー
76 .TP
77 .B EINVAL
78 .\"O .I sem
79 .\"O is not a valid semaphore.
80 .I sem
81 は有効なセマフォではない。
82 .TP
83 .B EOVERFLOW
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
88 .SH 準拠
89 POSIX.1-2001.
90 .\"O .SH NOTES
91 .SH 注意
92 .\"O .BR sem_post ()
93 .\"O is async-signal-safe:
94 .\"O it may be safely called within a signal handler.
95 .BR sem_post ()
96 は async-signal-safe である。
97 つまり、シグナルハンドラの中でも安全に呼び出すことができる。
98 .\"O .SH EXAMPLE
99 .SH 例
100 .\"O See
101 .\"O .BR sem_wait (3).
102 .BR sem_wait (3)
103 参照。
104 .\"O .SH "SEE ALSO"
105 .SH 関連項目
106 .BR sem_getvalue (3),
107 .BR sem_wait (3),
108 .BR sem_overview (7)