OSDN Git Service

3dd7280bf76eeb0a64bd926f6db94020b370688a
[linuxjm/LDP_man-pages.git] / draft / man2 / sigsuspend.2
1 .\" Copyright (c) 2005 Michael Kerrisk
2 .\" based on earlier work by faith@cs.unc.edu and
3 .\" Mike Battersby <mib@deakin.edu.au>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" 2005-09-15, mtk, Created new page by splitting off from sigaction.2
26 .\"
27 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
28 .\" Translated 2005-10-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .\"
30 .TH SIGSUSPEND 2 2008-08-29 "Linux" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH 名前
33 .\"O sigsuspend \- wait for a signal
34 sigsuspend \- シグナルを待つ
35 .\"O .SH SYNOPSIS
36 .SH 書式
37 .B #include <signal.h>
38 .sp
39 .BI "int sigsuspend(const sigset_t *" mask );
40 .sp
41 .in -4n
42 .\"O Feature Test Macro Requirements for glibc (see
43 .\"O .BR feature_test_macros (7)):
44 glibc 向けの機能検査マクロの要件
45 .RB ( feature_test_macros (7)
46 参照):
47 .in
48 .sp
49 .ad l
50 .BR sigsuspend ():
51 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
52 .ad b
53 .\"O .SH DESCRIPTION
54 .SH 説明
55 .\"O .BR sigsuspend ()
56 .\"O temporarily replaces the signal mask of the calling process with the
57 .\"O mask given by
58 .\"O .I mask
59 .\"O and then suspends the process until delivery of a signal whose
60 .\"O action is to invoke a signal handler or to terminate a process.
61 .BR sigsuspend ()
62 は、呼び出し元プロセスのシグナルマスクを
63 .I mask
64 で指定されたマスクに一時的に置き換え、
65 シグナルハンドラの起動もしくはプロセスの終了がアクションとして
66 設定されたシグナルが配送されるまで、そのプロセスを停止する。
67
68 .\"O If the signal terminates the process, then
69 .\"O .BR sigsuspend ()
70 .\"O does not return.
71 .\"O If the signal is caught, then
72 .\"O .BR sigsuspend ()
73 .\"O returns after the signal handler returns,
74 .\"O and the signal mask is restored to the state before the call to
75 .\"O .BR sigsuspend ().
76 シグナルがプロセスを終了させるものの場合、
77 .BR sigsuspend ()
78 は返らない。シグナルが捕捉された場合、
79 シグナルハンドラの処理が終わった後に
80 .BR sigsuspend ()
81 は返り、シグナルマスクは
82 .BR sigsuspend ()
83 が呼び出される前の状態に復元される。
84
85 .\"O It is not possible to block
86 .\"O .B SIGKILL
87 .\"O or
88 .\"O .BR SIGSTOP ;
89 .\"O specifying these signals in
90 .\"O .IR mask ,
91 .\"O has no effect on the process's signal mask.
92 .B SIGKILL
93
94 .B SIGSTOP
95 を禁止 (block) することはできない;
96 これらのシグナルを
97 .I mask
98 に指定しても、プロセスのシグナルマスクは影響を受けない。
99 .\"O .SH "RETURN VALUE"
100 .SH 返り値
101 .\"O .BR sigsuspend ()
102 .\"O always returns \-1, normally with the error
103 .\"O .BR EINTR .
104 .BR sigsuspend ()
105 は常に \-1 を返し、通常は
106 .B EINTR
107 エラーが発生する。
108 .\"O .SH ERRORS
109 .SH エラー
110 .TP
111 .B EFAULT
112 .\"O .I mask
113 .\"O points to memory which is not a valid part of the process address space.
114 .I mask
115 が指しているメモリが、プロセスのアドレス空間の有効な部分ではない。
116 .TP
117 .B EINTR
118 .\"O The call was interrupted by a signal.
119 システムコールはシグナルにより割り込まれた。
120 .\"O .SH "CONFORMING TO"
121 .SH 準拠
122 POSIX.1-2001.
123 .\"O .SH NOTES
124 .SH 注意
125 .PP
126 .\"O Normally,
127 .\"O .BR sigsuspend ()
128 .\"O is used in conjunction with
129 .\"O .BR sigprocmask (2)
130 .\"O in order to prevent delivery of a signal during the execution of a
131 .\"O critical code section.
132 .\"O The caller first blocks the signals with
133 .\"O .BR sigprocmask (2).
134 .\"O When the critical code has completed, the caller then waits for the
135 .\"O signals by calling
136 .\"O .BR sigsuspend ()
137 .\"O with the signal mask that was returned by
138 .\"O .BR sigprocmask (2)
139 .\"O (in the
140 .\"O .I oldset
141 .\"O argument).
142 .BR sigsuspend ()
143 は、通常、クリティカル・コード・セクション (critical code section) の
144 実行中にシグナルが配送されるのを防止するために、
145 .BR sigprocmask (2)
146 と組み合わせて使用される。
147 まず最初に、呼び出し元は
148 .BR sigprocmask (2)
149 を使ってシグナルを禁止する。
150 クリティカル・コードが完了すると、呼び出し元は
151 .BR sigprocmask (2)
152
153 .RI ( oldset
154 引き数で) 返すシグナルマスクを指定して
155 .BR sigsuspend ()
156 を呼び出すことで、クリティカル・コード実行中に発生した
157 シグナルを待つことができる。
158 .PP
159 .\"O See
160 .\"O .BR sigsetops (3)
161 .\"O for details on manipulating signal sets.
162 シグナル集合の操作に関する詳細は
163 .BR sigsetops (3)
164 を参照のこと。
165 .\"O .SH "SEE ALSO"
166 .SH 関連項目
167 .BR kill (2),
168 .BR pause (2),
169 .BR sigaction (2),
170 .BR signal (2),
171 .BR sigprocmask (2),
172 .BR sigwaitinfo (2),
173 .BR sigsetops (3),
174 .BR sigwait (3),
175 .BR signal (7)