OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / killpg.2
1 .\" Copyright (c) 1980, 1991 Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)killpg.2    6.5 (Berkeley) 3/10/91
33 .\"
34 .\" Modified Fri Jul 23 21:55:01 1993 by Rik Faith <faith@cs.unc.edu>
35 .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
36 .\" Modified 2004-06-16 by Michael Kerrisk <mtk.manpages@gmail.com>
37 .\"     Added notes on CAP_KILL
38 .\" Modified 2004-06-21 by aeb
39 .\"
40 .\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako
41 .\"         all rights reserved.
42 .\" Translated Sat May 17 14:10:42 JST 1997
43 .\"         by Kazuyuki Tanisako <tanisako@osa.dec-j.co.jp>
44 .\" Updated & Modified Sat Feb  5 21:24:32 JST 2005
45 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
46 .\"
47 .\"WORD:        process group           ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×
48 .\"WORD:        signal                  ¥·¥°¥Ê¥ë
49 .\"WORD:        effective user ID       ¼Â¸ú¥æ¡¼¥¶¡¼ID
50 .\"WORD:        super-user              ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
51 .\"
52 .TH KILLPG 2 2007-07-26 "Linux" "Linux Programmer's Manual"
53 .\"O .SH NAME
54 .SH Ì¾Á°
55 .\"O killpg \- send signal to a process group
56 killpg \- ¥·¥°¥Ê¥ë¤ò¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë
57 .\"O .SH SYNOPSIS
58 .SH ½ñ¼°
59 .B #include <signal.h>
60 .sp
61 .BI "int killpg(int " pgrp ", int " sig );
62 .sp
63 .in -4n
64 .\"O Feature Test Macro Requirements for glibc (see
65 .\"O .BR feature_test_macros (7)):
66 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
67 .RB ( feature_test_macros (7)
68 »²¾È):
69 .in
70 .sp
71 .BR killpg ():
72 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
73 .\"O .SH DESCRIPTION
74 .SH ÀâÌÀ
75 .\"O .BR killpg ()
76 .\"O sends the signal
77 .\"O .I sig
78 .\"O to the process group
79 .\"O .IR pgrp .
80 .BR killpg ()
81 ¤Ï
82 .I sig
83 ¤Ç»ØÄꤷ¤¿¥·¥°¥Ê¥ë¤ò
84 .I pgrp
85 ¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë¡£
86 ¥·¥°¥Ê¥ë¤ÎÄêµÁ¤Î°ìÍ÷¤Ï
87 .\"O See
88 .\"O .BR signal (7)
89 .\"O for a list of signals.
90 .BR signal (7)
91 ¤ò»²¾È¤Î¤³¤È¡£
92
93 .\"O If
94 .\"O .I pgrp
95 .\"O is 0,
96 .\"O .BR killpg ()
97 .\"O sends the signal to the sending process's process group.
98 .\"O sends the signal to the calling process's process group.
99 °ú¤­¿ô
100 .I pgrp
101 ¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï
102 .BR killpg ()
103 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬Â°¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÂФ·¤Æ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
104 .\"O (POSIX says: If
105 .\"O .I pgrp
106 .\"O is less than or equal to 1, the behavior is undefined.)
107 (POSIX ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë:
108 .I pgrp
109 ¤¬ 1 °Ê²¼¤Ç¤¢¤ë¾ì¹ç¡¢Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£)
110
111 .\"O For a process to have permission to send a signal
112 .\"O it must either be privileged (under Linux: have the
113 .\"O .B CAP_KILL
114 .\"O capability), or the real or effective
115 .\"O user ID of the sending process must equal the real or
116 .\"O saved set-user-ID of the target process.
117 ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤ò»ý¤Ä¤¿¤á¤Ë¤Ï¡¢
118 ¥×¥í¥»¥¹¤¬Æø¢ (Linux ¤Ç¤Ï
119 .B CAP_KILL
120 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤ò»ý¤Ä¤«¡¢
121 Á÷¿®¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬
122 Á÷¿®Àè¥×¥í¥»¥¹¤Î¼Â set-user-ID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È
123 Åù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
124 .\"O In the case of
125 .\"O .B SIGCONT
126 .\"O it suffices when the sending and receiving
127 .\"O processes belong to the same session.
128 .B SIGCONT
129 ¤Î¾ì¹ç¡¢Á÷¿®¥×¥í¥»¥¹¤È¼õ¿®¥×¥í¥»¥¹¤¬
130 Ʊ¤¸¥»¥Ã¥·¥ç¥ó¤Ë°¤·¤Æ¤¤¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£
131 .\"O .SH "RETURN VALUE"
132 .SH ÊÖ¤êÃÍ
133 .\"O On success, zero is returned.
134 .\"O On error, \-1 is returned, and
135 .\"O .I errno
136 .\"O is set appropriately.
137 Àµ¾ï½ªÎ»¤¹¤ë¤È 0 ¤¬ÊÖ¤êÃͤȤʤ롣°Û¾ï½ªÎ»¤Î¾ì¹ç \-1 ¤¬ÊÖ¤êÃͤȤʤê
138 .I errno
139 ¤Ë¸¶°ø¥³¡¼¥É¤¬ÀßÄꤵ¤ì¤ë¡£
140 .\"O .SH ERRORS
141 .SH ¥¨¥é¡¼
142 .TP
143 .B EINVAL
144 .\"O .I Sig
145 .\"O is not a valid signal number.
146 .I sig
147 ¤Ç»ØÄꤵ¤ì¤¿ÃͤÏ̵¸ú¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤¢¤ë¡£
148 .TP
149 .B EPERM
150 .\"O The process does not have permission to send the signal
151 .\"O to any of the target processes.
152 ¥×¥í¥»¥¹¤Ë²¿¤ì¤«¤ÎÁ÷¿®Àè¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤¬¤Ê¤¤¡£
153 .TP
154 .B ESRCH
155 .\"O No process can be found in the process group specified by
156 .\"O .IR pgrp .
157 .I pgrp
158 ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£
159 .TP
160 .B ESRCH
161 .\"O The process group was given as 0 but the sending process does not
162 .\"O have a process group.
163 ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤È¤·¤Æ 0 ¤¬»ØÄꤵ¤ì¤¿¤¬¡¢Á÷¿®¥×¥í¥»¥¹¤Ï
164 ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
165 .\"O .SH "CONFORMING TO"
166 .SH ½àµò
167 .\"O SVr4, 4.4BSD (the
168 .\"O .BR killpg ()
169 .\"O function call first appeared in 4BSD), POSIX.1-2001.
170 SVr4, 4.4BSD
171 .RB ( killpg ()
172 ¤Ï 4BSD ¤Ç½é¤á¤ÆÄɲ䵤줿), POSIX.1-2001¡£
173 .\"O .SH NOTES
174 .SH Ãí°Õ
175 .\"O There are various differences between the permission checking
176 .\"O in BSD-type systems and System V-type systems.
177 .\"O See the POSIX rationale for
178 .\"O .BR kill ().
179 .\"O A difference not mentioned by POSIX concerns the return
180 .\"O value
181 .\"O .BR EPERM :
182 .\"O BSD documents that no signal is sent and
183 .\"O .B EPERM
184 .\"O returned when the permission check failed for at least one target process,
185 .\"O while POSIX documents
186 .\"O .B EPERM
187 .\"O only when the permission check failed for all target processes.
188 BSD ·Ï¥·¥¹¥Æ¥à¤È System V ·Ï¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
189 µö²Ä¤Î¥Á¥§¥Ã¥¯¤ËÍÍ¡¹¤Ê°ã¤¤¤¬¤¢¤ë¡£
190 .BR kill (2)
191 ¤Ë¤Ä¤¤¤Æ¤Î POSIX ¤Î¸¶Íý (rationale) ¤ò»²¾È¤¹¤ë¤³¤È¡£
192 POSIX ¤Çµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤°ã¤¤¤È¤·¤Æ¤Ï¡¢ÊÖ¤êÃÍ
193 .B EPERM
194 ¤¬¤¢¤ë¡£
195 BSD ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬ 1 ¤Ä¤Ç¤â¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢
196 ¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤º¡¢
197 .B EPERM
198 ¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£
199 POSIX ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬Á´¤Æ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Î¤ß¡¢
200 .B EPERM
201 ¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£
202
203 .\"O On Linux,
204 .\"O .BR killpg ()
205 .\"O is implemented as a library function that makes the call
206 .\"O .IR "kill(-pgrp,\ sig)" .
207 Linux ¤Ç¤Ï¡¢
208 .BR killpg ()
209 ¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢
210 .I "kill(-pgrp,\ sig)"
211 ¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¡£
212 .\"O .SH "SEE ALSO"
213 .SH ´ØÏ¢¹àÌÜ
214 .BR getpgrp (2),
215 .BR kill (2),
216 .BR signal (2),
217 .BR credentials (7),
218 .BR capabilities (7)