OSDN Git Service

6101b27a1801fd9ff287652b4b1cde4c77cab68e
[linuxjm/LDP_man-pages.git] / draft / man3 / sigset.3
1 .\" t
2 .\" Copyright (c) 2005 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
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 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH SIGSET 3 2010\-09\-20 Linux "Linux Programmer's Manual"
32 .SH 名前
33 sigset, sighold, sigrelse, sigignore \- System V 版シグナル API
34 .SH 書式
35 \fB#include <signal.h>\fP
36 .sp
37 \fBtypedef void (*sighandler_t)(int);\fP
38 .sp
39 \fBsighandler_t sigset(int \fP\fIsig\fP\fB, sighandler_t \fP\fIdisp\fP\fB);\fP
40 .sp
41 \fBint sighold(int \fP\fIsig\fP\fB);\fP
42 .sp
43 \fBint sigrelse(int \fP\fIsig\fP\fB);\fP
44 .sp
45 \fBint sigignore(int \fP\fIsig\fP\fB);\fP
46 .sp
47 .in -4n
48 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
49 .in
50 .sp
51 .ad l
52 \fBsigset\fP(), \fBsighold\fP(), \fBsigrelse\fP(), \fBsigignore\fP():
53 .br
54 .RS 4
55 _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
56 .RE
57 .ad
58 .SH 説明
59 これらの関数は、昔ながらの System V 版シグナル API を使用しているプログラム に対して互換性のあるインタフェースを glibc
60 で提供するものである。 この API は過去のものであり、新しいアプリケーションでは POSIX シグナル API (\fBsigaction\fP(2),
61 \fBsigprocmask\fP(2)  など) を使用すべきである。
62
63 関数 \fBsigset\fP()  はシグナル \fIsig\fP のシグナルハンドラの動作を変更する。 \fIdisp\fP
64 引き数には、シグナルハンドラ関数のアドレスか、 以下の定数のいずれか一つを指定できる。
65 .TP 
66 \fBSIG_DFL\fP
67 \fIsig\fP の動作をデフォルトにリセットする。
68 .TP 
69 \fBSIG_IGN\fP
70 \fIsig\fP を無視する。
71 .TP 
72 \fBSIG_HOLD\fP
73 そのプロセスのシグナルマスクに \fIsig\fP を追加するが、 \fIsig\fP の動作は変更しない。
74 .PP
75 \fIdisp\fP にシグナルハンドラのアドレスが指定された場合、 シグナルハンドラの実行中は、そのプロセスのシグナルマスクに \fIsig\fP が追加される。
76 .PP
77 \fIdisp\fP に \fBSIG_HOLD\fP 以外の値が指定された場合、 そのプロセスのシグナルマスクから \fIsig\fP が削除される。
78 .PP
79 シグナル \fBSIGKILL\fP と \fBSIGSTOP\fP に対する動作は変更できない。
80 .PP
81 関数 \fBsighold\fP()  は、呼び出し元プロセスのシグナルマスクに \fIsig\fP を追加する。
82
83 関数 \fBsigrelse\fP()  は、呼び出し元プロセスのシグナルマスクから \fIsig\fP を削除する。
84
85 関数 \fBsigignore\fP()  は、 \fIsig\fP の動作を \fBSIG_IGN\fP に設定する。
86 .SH 返り値
87 \fBsigset\fP()  は成功すると、 呼び出し前に \fIsig\fP がブロックされていた場合には \fBSIG_HOLD\fP を返し、
88 ブロックされていなかった場合には 変更前のそのシグナルの動作を返す。 エラーの場合、 \fBsigset\fP()  は \-1 を返し、 \fIerrno\fP
89 にエラーを示す値をセットする。 但し、以下の「バグ」の節も参照のこと。
90
91 関数 \fBsighold\fP(), \fBsigrelse\fP(), \fBsigignore\fP()  は成功すると 0 を返す。エラーの場合、\-1 を返し、
92 \fIerrno\fP にエラーを示す値をセットする。
93 .SH エラー
94 \fBsigset\fP()  に関しては、 \fBsigaction\fP(2)  と \fBsigprocmask\fP(2)  の「エラー」の節を参照。
95
96 \fBsighold\fP()  と \fBsigrelse\fP()  に関しては、 \fBsigprocmask\fP(2)  の「エラー」の節を参照。
97
98 \fBsigignore\fP()  に関しては、 \fBsigaction\fP(2)  の「エラー」の節を参照。
99 .SH 準拠
100 SVr4, POSIX.1\-2001.  これらの関数は廃止予定である。新しいプログラムでは使用しないこと。 POSIX.1\-2008 は、
101 \fBsighold\fP(), \fBsigignore\fP(), \fBsigpause\fP(), \fBsigrelse\fP(), \fBsigset\fP()
102 を廃止予定としている。 代わりに、 \fBsigaction\fP(2), \fBsigprocmask\fP(2), \fBpthread_sigmask\fP(3),
103 \fBsigsuspend\fP(2)  の使用が推奨されている。
104 .SH 注意
105 これらの関数は glibc 2.1 で登場した。
106
107 \fIsighandler_t\fP 型は GNU による拡張であり、この man page で \fBsigset\fP()
108 のプロトタイプをより読みやすくするために使われているだけである。
109
110 関数 \fBsigset\fP()  は信頼性のあるシグナル処理機構を提供する (\fIsa_mask\fP を 0 で \fBsigaction\fP(2)
111 を呼び出したときと同様)。
112
113 System V では、関数 \fBsignal\fP()  が提供する処理機構は信頼性のないものである (\fIsa_mask\fP を
114 \fISA_RESETHAND | SA_NODEFER\fP として \fBsigaction\fP(2)  を呼び出したときと同様)。 BSD では、
115 \fBsignal\fP()  は信頼性のある処理機構を提供する。 POSIX.1\-2001 では、 \fBsignal\fP()
116 のこの点は規定しないままとなっている。 さらなる詳細については \fBsignal\fP(2)  を参照。
117
118 BSD と System V のどちらのシステムでも シグナルを待つために、 \fBsigpause\fP(3)  という名前の関数が提供されているが、
119 この関数の引き数は両方のシステムで異なる。 詳細は \fBsigpause\fP(3)  を参照。
120 .SH バグ
121 2.2 より前のバージョンの glibc では、 \fIdisp\fP に \fBSIG_HOLD\fP 以外の値が指定された場合、 \fIsig\fP
122 のブロック解除を行っていなかった。
123
124 .\" See http://sourceware.org/bugzilla/show_bug.cgi?id=1951
125 2.3.5 以前の全てのバージョンの glibc では、 \fBsigset\fP()  が変更前のシグナルの動作を正しく返さない場合が 2つある。
126 一つめは、 \fIdisp\fP に \fBSIG_HOLD\fP が指定されると、成功した場合 \fBsigset\fP()  は常に \fBSIG_HOLD\fP
127 を返すことである。 正しくは、(シグナルがブロックされていなかった場合には)  変更前のシグナルの動作を返すべきである
128 (シグナルがブロックされていた場合には、 \fBSIG_HOLD\fP が返される)。 もう一つは、シグナルが現在ブロックされている場合には、 成功した場合の
129 \fBsigset\fP()  の返り値は \fBSIG_HOLD\fP になるべきであるが、実際には 変更前のシグナルの動作が返されることである。 これらの問題は
130 glibc 2.5 以降で修正されている。
131 .SH 関連項目
132 \fBkill\fP(2), \fBpause\fP(2), \fBsigaction\fP(2), \fBsignal\fP(2), \fBsigprocmask\fP(2),
133 \fBraise\fP(3), \fBsigpause\fP(3), \fBsigvec\fP(3), \fBsignal\fP(7)
134 .SH この文書について
135 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
136 である。プロジェクトの説明とバグ報告に関する情報は
137 http://www.kernel.org/doc/man\-pages/ に書かれている。