2 .\" Copyright (c) 2005 by Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
25 .\" Translated 2005-12-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
27 .TH SIGVEC 3 2007-07-26 "Linux" "Linux Programmer's Manual"
30 .\"O sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD signal API
31 sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD 版シグナル API
34 .B #include <signal.h>
36 .BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec );
38 .BI "int sigmask(int " signum );
40 .BI "int sigblock(int " mask );
42 .BI "int sigsetmask(int " mask );
44 .B int siggetmask(void);
47 .\"O Feature Test Macro Requirements for glibc (see
48 .\"O .BR feature_test_macros (7)):
50 .RB ( feature_test_macros (7)
54 .\"O All functions shown above:
59 .\"O These functions are provided in glibc as a compatibility interface
60 .\"O for programs that make use of the historical BSD signal API.
61 .\"O This API is obsolete: new applications should use the POSIX signal API
62 .\"O .RB ( sigaction (2),
63 .\"O .BR sigprocmask (2),
65 これらの関数は、昔ながらの BSD 版シグナル API を使用しているプログラム
66 に対して互換性のあるインタフェースを glibc で提供するものである。
67 この API は過去のものであり、新しいアプリケーションでは
75 .\"O function sets and/or gets the disposition of the signal
78 .\"O .BR sigaction (2)).
88 .\"O is not NULL, it points to a
90 .\"O structure that defines the new disposition for
100 .\"O is not NULL, it points to a
102 .\"O structure that is used to return the previous disposition of
110 .\"O To obtain the current disposition of
112 .\"O without changing it, specify NULL for
114 .\"O and a non-NULL pointer for
117 の動作を変更せずに現在の動作を取得するためには、
121 に NULL でないポインタを指定すればよい。
123 .\"O The dispositions for
127 .\"O cannot be changed.
135 .\"O structure has the following form:
142 void (*sv_handler)(); /* Signal disposition */
143 int sv_mask; /* Signals to be blocked in handler */
144 int sv_flags; /* Flags */
151 .\"O field specifies the disposition of the signal, and is either:
152 .\"O the address of a signal handler function; or
154 .\"O meaning the default disposition applies for the signal; or
156 .\"O meaning that the signal is ignored.
158 フィールドはシグナルの動作を指定するもので、
165 はシグナルに適用されるデフォルトの動作を意味し、
171 .\"O specifies the address of a signal handler, then
173 .\"O specifies a mask of signals that are to be blocked while
174 .\"O the handler is executing.
175 .\"O In addition, the signal for which the handler is invoked is
176 .\"O also blocked by default.
177 .\"O Attempts to block
181 .\"O are silently ignored.
183 にシグナルハンドラのアドレスを指定した場合、
185 はハンドラが実行中にブロックされるべきシグナルのマスクを指定する。
186 また、ハンドラを起動したシグナル自身はデフォルトでブロックされる。
190 をブロックしようとした場合には、黙って無視される。
194 .\"O specifies the address of a signal handler, then the
196 .\"O field specifies flags controlling what happens when the handler is called.
197 .\"O This field may contain zero or more of the following flags:
199 にシグナルハンドラのアドレスを指定した場合、
201 フィールドはハンドラが呼ばれた際の挙動を制御するフラグを指定する。
202 このフィールドには、0 か、以下のフラグを 1個以上指定できる:
205 .\"O If the signal handler interrupts a blocking system call,
206 .\"O then upon return from the handler the system call will not be restarted:
207 .\"O instead it will fail with the error
209 .\"O If this flag is not specified, then system calls are restarted
211 シグナルハンドラが停止中のシステムコールを中断した場合、
212 ハンドラから復帰しても、システムコールは再開されず、
216 このフラグを指定しなかった場合、システムコールは
220 .\"O Reset the disposition of the signal to the default
221 .\"O before calling the signal handler.
222 .\"O If this flag is not specified, then the handler remains established
223 .\"O until explicitly removed by a later call to
225 .\"O or until the process performs an
227 シグナルハンドラを呼び出す前にシグナルの動作を
231 を呼び出して明示的に削除されるか、プロセスが
233 を実行するまで、ハンドラは設定されたままとなる。
236 .\"O Handle the signal on the alternate signal stack
237 .\"O (historically established under BSD using the obsolete
239 .\"O function; the POSIX replacement is
240 .\"O .BR sigaltstack (2)).
241 代替シグナルスタック上でシグナルハンドラを実行する
242 (歴史的に、BSD では代替シグナルスタックは廃止された関数
244 を使って設定する。POSIX では、代わりに
250 .\"O function constructs and returns a "signal mask" for
252 .\"O For example, we can initialize the
256 .\"O using code such as the following:
261 に対する「シグナルマスク」を構成して返す。
269 vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT);
270 /* Block SIGQUIT and SIGABRT during
276 .\"O function adds the signals in
278 .\"O to the process's signal mask
280 .\"O .IR sigprocmask(SIG_BLOCK) ),
281 .\"O and returns the process's previous signal mask.
282 .\"O Attempts to block
286 .\"O are silently ignored.
290 にあるシグナルをプロセスのシグナルマスクに追加し
292 .I sigprocmask(SIG_BLOCK)
293 と同様)、変更前のプロセスのシグナルマスクを返す。
297 をブロックしようとした場合には、黙って無視される。
300 .\"O .BR sigsetmask ()
301 .\"O function sets the process's signal mask to the value given in
304 .\"O .IR sigprocmask(SIG_SETMASK) ),
305 .\"O and returns the process's previous signal mask.
310 .I sigprocmask(SIG_SETMASK)
311 と同様)、変更前のプロセスのシグナルマスクを返す。
314 .\"O .BR siggetmask ()
315 .\"O function returns the process's current signal mask.
316 .\"O This call is equivalent to
317 .\"O .IR sigblock(0) .
319 関数はプロセスの現在のシグナルマスクを返す。この関数は
322 .\"O .SH RETURN VALUE
326 .\"O function returns 0 on success; on error, it returns \-1 and sets
328 .\"O to indicate the error.
330 関数は成功すると 0 を返す。エラーの場合、\-1 を返し、
337 .\"O .BR sigsetmask ()
338 .\"O functions return the previous signal mask.
346 .\"O function returns the signal mask for
354 .\"O See the ERRORS under
355 .\"O .BR sigaction (2)
357 .\"O .BR sigprocmask (2).
362 .\"O .SH "CONFORMING TO"
364 .\"O All of these functions were in
366 .\"O .BR siggetmask (),
367 .\"O whose origin is unclear.
368 .\"O These functions are obsolete: do not use them in new programs.
374 これらの関数は廃止予定であり、新しいプログラムでは使用しないこと。
379 .\"O function provided reliable semantics (as when calling
384 4.3BSD では、信頼性のあるシグナル処理機構を提供する
391 .\"O provides unreliable semantics.
392 System V が提供する処理機構は信頼性のないものである。
393 .\"O POSIX.1-2001 leaves these aspects of
398 .\"O for further details.
406 .\"O In order to wait for a signal,
407 .\"O BSD and System V both provided a function named
408 .\"O .BR sigpause (3),
409 .\"O but this function has a different argument on the two systems.
411 .\"O .BR sigpause (3)
413 BSD と System V のどちらのシステムでも
417 この関数の引き数は両方のシステムで異なる。