OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man2 / sigprocmask.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 SIGPROCMASK 2 2008-10-17 "Linux" "Linux Programmer's Manual"
31 .SH 名前
32 sigprocmask \- 禁止するシグナルの確認と変更
33 .SH 書式
34 .B #include <signal.h>
35 .sp
36 .BI "int sigprocmask(int " how ", const sigset_t *" set ,
37 .BI "sigset_t *" oldset );
38 .sp
39 .in -4n
40 glibc 向けの機能検査マクロの要件
41 .RB ( feature_test_macros (7)
42 参照):
43 .in
44 .sp
45 .ad l
46 .BR sigprocmask ():
47 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
48 .ad b
49 .SH 説明
50 .BR sigprocmask ()
51 を使うと、呼び出したスレッドのシグナルマスクの取得/変更ができる。
52 シグナルマスクは、呼び出し元に対して現在配送が禁止されているシグナルの
53 集合のことである (詳細については
54 .BR signal (7)
55 も参照のこと)。
56
57 このコールの動作は
58 .I how
59 の値によって決まる:
60 .TP
61 .B SIG_BLOCK
62 禁止されたシグナルの集合は現在の値と
63 .I set
64 引き数を結合したものとなる。
65 .TP
66 .B SIG_UNBLOCK
67 現在禁止されているシグナルの集合から
68 .I set
69 にあるシグナルを取り除く。禁止されていないシグナルを取り除こうと
70 することも認められている。
71 .TP
72 .B SIG_SETMASK
73 禁止されているシグナルの集合に
74 .I set
75 引き数を設定する。
76 .PP
77 .I oldset
78 が NULL でなければ、シグナルマスクの今までの値を
79 .I oldset
80 に格納する。
81
82 .I set
83 が NULL であれば、シグナルマスクは変更されない (すなわち、
84 .I how
85 は無視される)。
86 .I set
87 の値にかかわらず、現在のシグナルマスクの値は
88 .I oldset
89 に入れて返される (但し、
90 .I oldset
91 が NULL でない場合)。
92
93 マルチスレッドのプロセスで
94 .BR sigprocmask ()
95 を使用した場合の動作は規定されていない。
96 .BR pthread_sigmask (3)
97 を参照のこと。
98 .SH 返り値
99 .BR sigprocmask ()
100 は成功すれば 0 を返し、エラーならば \-1 を返す。
101 .SH エラー
102 .B EINVAL
103 .I how
104 に指定された値が有効ではない。
105 .SH 準拠
106 POSIX.1-2001.
107 .SH 注意
108 .B SIGKILL
109
110 .B SIGSTOP
111 を禁止することはできない。
112 禁止しようとしても黙って無視される。
113
114 プロセス内の各スレッドはそれぞれ専用のシグナルマスクを持つ。
115
116 .BR fork (2)
117 経由で作成された子プロセスは親プロセスのシグナルマスクのコピーを継承する。
118 .BR execve (2)
119 の前後でシグナルマスクは保持される。
120
121 シグナル
122 .BR SIGBUS ,
123 .BR SIGFPE ,
124 .BR SIGILL ,
125 .B SIGSEGV
126 が禁止されている間に生成された場合で、
127 そのシグナルが
128 .BR kill (2),
129 .BR sigqueue (3),
130 .BR raise (3)
131 によって生成されたものでないときには、
132 その後の動作は未定義である。
133 .PP
134 シグナル集合の操作に関する詳細は
135 .BR sigsetops (3)
136 を参照のこと。
137 .SH 関連項目
138 .BR kill (2),
139 .BR pause (2),
140 .BR sigaction (2),
141 .BR signal (2),
142 .BR sigpending (2),
143 .BR sigsuspend (2),
144 .BR pthread_sigmask (3),
145 .BR sigqueue (3),
146 .BR sigsetops (3),
147 .BR signal (7)