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 プロセス・グループ
49 .\"WORD: effective user ID 実効ユーザーID
50 .\"WORD: super-user スーパー・ユーザー
52 .TH KILLPG 2 2010-09-20 "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)):
67 .RB ( feature_test_macros (7)
74 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
75 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
82 .\"O to the process group
93 .\"O for a list of signals.
101 .\"O sends the signal to the sending process's process group.
102 .\"O sends the signal to the calling process's process group.
107 は呼び出し元のプロセスが属しているプロセス・グループに対してシグナルを送る。
110 .\"O is less than or equal to 1, the behavior is undefined.)
111 (POSIX では以下のように記述されている:
113 が 1 以下である場合、動作は未定義である。)
115 .\"O For a process to have permission to send a signal
116 .\"O it must either be privileged (under Linux: have the
118 .\"O capability), or the real or effective
119 .\"O user ID of the sending process must equal the real or
120 .\"O saved set-user-ID of the target process.
121 プロセスがシグナルを送信する許可を持つためには、
124 ケーパビリティ (capability)) を持つか、
125 送信元プロセスの実ユーザー ID または実効ユーザー ID が
126 送信先プロセスの実 set-user-ID または保存 set-user-ID と
130 .\"O it suffices when the sending and receiving
131 .\"O processes belong to the same session.
135 .\"O .SH "RETURN VALUE"
137 .\"O On success, zero is returned.
138 .\"O On error, \-1 is returned, and
140 .\"O is set appropriately.
141 正常終了すると 0 が返り値となる。異常終了の場合 \-1 が返り値となり
149 .\"O is not a valid signal number.
151 で指定された値は無効なシグナル番号である。
154 .\"O The process does not have permission to send the signal
155 .\"O to any of the target processes.
156 プロセスに何れかの送信先プロセスにシグナルを送信する許可がない。
159 .\"O No process can be found in the process group specified by
162 で指定されたプロセス・グループに属するプロセスが存在しなかった。
165 .\"O The process group was given as 0 but the sending process does not
166 .\"O have a process group.
167 プロセス・グループとして 0 が指定されたが、送信プロセスは
169 .\"O .SH "CONFORMING TO"
171 .\"O SVr4, 4.4BSD (the
173 .\"O function call first appeared in 4BSD), POSIX.1-2001.
176 は 4BSD で初めて追加された), POSIX.1-2001。
179 .\"O There are various differences between the permission checking
180 .\"O in BSD-type systems and System V-type systems.
181 .\"O See the POSIX rationale for
183 .\"O A difference not mentioned by POSIX concerns the return
186 .\"O BSD documents that no signal is sent and
188 .\"O returned when the permission check failed for at least one target process,
189 .\"O while POSIX documents
191 .\"O only when the permission check failed for all target processes.
192 BSD 系システムと System V 系システムでは、
195 についての POSIX の原理 (rationale) を参照すること。
196 POSIX で記述されていない違いとしては、返り値
199 BSD では「送信先プロセスの許可のチェックが 1 つでも失敗した場合は、
203 POSIX では「送信先プロセスの許可のチェックが全て失敗した場合にのみ、
209 .\"O is implemented as a library function that makes the call
210 .\"O .IR "kill(-pgrp,\ sig)" .
214 .I "kill(-pgrp,\ sig)"