OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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)