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"
29 sigvec, sigblock, sigsetmask, siggetmask, sigmask \- BSD 版シグナル API
31 .B #include <signal.h>
33 .BI "int sigvec(int " sig ", struct sigvec *" vec ", struct sigvec *" ovec );
35 .BI "int sigmask(int " signum );
37 .BI "int sigblock(int " mask );
39 .BI "int sigsetmask(int " mask );
41 .B int siggetmask(void);
45 .RB ( feature_test_macros (7)
52 これらの関数は、昔ながらの BSD 版シグナル API を使用しているプログラム
53 に対して互換性のあるインタフェースを glibc で提供するものである。
54 この API は過去のものであり、新しいアプリケーションでは
80 の動作を変更せずに現在の動作を取得するためには、
84 に NULL でないポインタを指定すればよい。
97 void (*sv_handler)(); /* Signal disposition */
98 int sv_mask; /* Signals to be blocked in handler */
99 int sv_flags; /* Flags */
105 フィールドはシグナルの動作を指定するもので、
112 はシグナルに適用されるデフォルトの動作を意味し、
117 にシグナルハンドラのアドレスを指定した場合、
119 はハンドラが実行中にブロックされるべきシグナルのマスクを指定する。
120 また、ハンドラを起動したシグナル自身はデフォルトでブロックされる。
124 をブロックしようとした場合には、黙って無視される。
127 にシグナルハンドラのアドレスを指定した場合、
129 フィールドはハンドラが呼ばれた際の挙動を制御するフラグを指定する。
130 このフィールドには、0 か、以下のフラグを 1個以上指定できる:
133 シグナルハンドラが停止中のシステムコールを中断した場合、
134 ハンドラから復帰しても、システムコールは再開されず、
138 このフラグを指定しなかった場合、システムコールは
142 シグナルハンドラを呼び出す前にシグナルの動作を
146 を呼び出して明示的に削除されるか、プロセスが
148 を実行するまで、ハンドラは設定されたままとなる。
151 代替シグナルスタック上でシグナルハンドラを実行する
152 (歴史的に、BSD では代替シグナルスタックは廃止された関数
154 を使って設定する。POSIX では、代わりに
162 に対する「シグナルマスク」を構成して返す。
170 vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT);
171 /* Block SIGQUIT and SIGABRT during
178 にあるシグナルをプロセスのシグナルマスクに追加し
180 .I sigprocmask(SIG_BLOCK)
181 と同様)、変更前のプロセスのシグナルマスクを返す。
185 をブロックしようとした場合には、黙って無視される。
191 .I sigprocmask(SIG_SETMASK)
192 と同様)、変更前のプロセスのシグナルマスクを返す。
195 関数はプロセスの現在のシグナルマスクを返す。この関数は
200 関数は成功すると 0 を返す。エラーの場合、\-1 を返し、
224 これらの関数は廃止予定であり、新しいプログラムでは使用しないこと。
226 4.3BSD では、信頼性のあるシグナル処理機構を提供する
231 System V が提供する処理機構は信頼性のないものである。
239 BSD と System V のどちらのシステムでも
243 この関数の引き数は両方のシステムで異なる。