1 .\" Copyright (c) 1980, 1991 Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
32 .\" @(#)killpg.2 6.5 (Berkeley) 3/10/91
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
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>
47 .\"WORD: process group ¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×
48 .\"WORD: signal ¥·¥°¥Ê¥ë
49 .\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID
50 .\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
52 .TH KILLPG 2 2007-07-26 "Linux" "Linux Programmer's Manual"
55 .\"O killpg \- send signal to a process group
56 killpg \- ¥·¥°¥Ê¥ë¤ò¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë
59 .B #include <signal.h>
61 .BI "int killpg(int " pgrp ", int " sig );
64 .\"O Feature Test Macro Requirements for glibc (see
65 .\"O .BR feature_test_macros (7)):
66 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
67 .RB ( feature_test_macros (7)
72 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
78 .\"O to the process group
85 ¤Ç»ØÄꤷ¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤ë¡£
86 ¥·¥°¥Ê¥ë¤ÎÄêµÁ¤Î°ìÍ÷¤Ï
89 .\"O for a list of signals.
97 .\"O sends the signal to the sending process's process group.
98 .\"O sends the signal to the calling process's process group.
101 ¤Ë 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï
103 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬Â°¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÂФ·¤Æ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
106 .\"O is less than or equal to 1, the behavior is undefined.)
107 (POSIX ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤ë:
109 ¤¬ 1 °Ê²¼¤Ç¤¢¤ë¾ì¹ç¡¢Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£)
111 .\"O For a process to have permission to send a signal
112 .\"O it must either be privileged (under Linux: have the
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 ¤Ç¤Ï
120 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability)) ¤ò»ý¤Ä¤«¡¢
121 Á÷¿®¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬
122 Á÷¿®Àè¥×¥í¥»¥¹¤Î¼Â set-user-ID ¤Þ¤¿¤ÏÊݸ set-user-ID ¤È
123 Åù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
126 .\"O it suffices when the sending and receiving
127 .\"O processes belong to the same session.
129 ¤Î¾ì¹ç¡¢Á÷¿®¥×¥í¥»¥¹¤È¼õ¿®¥×¥í¥»¥¹¤¬
130 Ʊ¤¸¥»¥Ã¥·¥ç¥ó¤Ë°¤·¤Æ¤¤¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£
131 .\"O .SH "RETURN VALUE"
133 .\"O On success, zero is returned.
134 .\"O On error, \-1 is returned, and
136 .\"O is set appropriately.
137 Àµ¾ï½ªÎ»¤¹¤ë¤È 0 ¤¬ÊÖ¤êÃͤȤʤ롣°Û¾ï½ªÎ»¤Î¾ì¹ç \-1 ¤¬ÊÖ¤êÃͤȤʤê
139 ¤Ë¸¶°ø¥³¡¼¥É¤¬ÀßÄꤵ¤ì¤ë¡£
145 .\"O is not a valid signal number.
147 ¤Ç»ØÄꤵ¤ì¤¿ÃͤÏ̵¸ú¤Ê¥·¥°¥Ê¥ëÈÖ¹æ¤Ç¤¢¤ë¡£
150 .\"O The process does not have permission to send the signal
151 .\"O to any of the target processes.
152 ¥×¥í¥»¥¹¤Ë²¿¤ì¤«¤ÎÁ÷¿®Àè¥×¥í¥»¥¹¤Ë¥·¥°¥Ê¥ë¤òÁ÷¿®¤¹¤ëµö²Ä¤¬¤Ê¤¤¡£
155 .\"O No process can be found in the process group specified by
158 ¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥×¥í¥»¥¹¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£
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"
167 .\"O SVr4, 4.4BSD (the
169 .\"O function call first appeared in 4BSD), POSIX.1-2001.
172 ¤Ï 4BSD ¤Ç½é¤á¤ÆÄɲ䵤줿), POSIX.1-2001¡£
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
179 .\"O A difference not mentioned by POSIX concerns the return
182 .\"O BSD documents that no signal is sent and
184 .\"O returned when the permission check failed for at least one target process,
185 .\"O while POSIX documents
187 .\"O only when the permission check failed for all target processes.
188 BSD ·Ï¥·¥¹¥Æ¥à¤È System V ·Ï¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
189 µö²Ä¤Î¥Á¥§¥Ã¥¯¤ËÍÍ¡¹¤Ê°ã¤¤¤¬¤¢¤ë¡£
191 ¤Ë¤Ä¤¤¤Æ¤Î POSIX ¤Î¸¶Íý (rationale) ¤ò»²¾È¤¹¤ë¤³¤È¡£
192 POSIX ¤Çµ½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤°ã¤¤¤È¤·¤Æ¤Ï¡¢ÊÖ¤êÃÍ
195 BSD ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬ 1 ¤Ä¤Ç¤â¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢
196 ¥·¥°¥Ê¥ë¤¬Á÷¿®¤µ¤ì¤º¡¢
198 ¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ½Ò¤µ¤ì¤Æ¤¤¤ë¡£
199 POSIX ¤Ç¤Ï¡ÖÁ÷¿®Àè¥×¥í¥»¥¹¤Îµö²Ä¤Î¥Á¥§¥Ã¥¯¤¬Á´¤Æ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Î¤ß¡¢
201 ¤¬ÊÖ¤µ¤ì¤ë¡×¤Èµ½Ò¤µ¤ì¤Æ¤¤¤ë¡£
205 .\"O is implemented as a library function that makes the call
206 .\"O .IR "kill(-pgrp,\ sig)" .
209 ¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢
210 .I "kill(-pgrp,\ sig)"
211 ¤Î¸Æ¤Ó½Ð¤·¤¬¹Ô¤ï¤ì¤ë¡£