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 .TH KILLPG 2 2007-07-26 "Linux" "Linux Programmer's Manual"
42 killpg \- send signal to a process group
44 .B #include <signal.h>
46 .BI "int killpg(int " pgrp ", int " sig );
49 Feature Test Macro Requirements for glibc (see
50 .BR feature_test_macros (7)):
54 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
63 for a list of signals.
69 sends the signal to the calling process's process group.
72 is less than or equal to 1, the behavior is undefined.)
74 For a process to have permission to send a signal
75 it must either be privileged (under Linux: have the
77 capability), or the real or effective
78 user ID of the sending process must equal the real or
79 saved set-user-ID of the target process.
82 it suffices when the sending and receiving
83 processes belong to the same session.
85 On success, zero is returned.
86 On error, \-1 is returned, and
93 is not a valid signal number.
96 The process does not have permission to send the signal
97 to any of the target processes.
100 No process can be found in the process group specified by
104 The process group was given as 0 but the sending process does not
105 have a process group.
109 function call first appeared in 4BSD), POSIX.1-2001.
111 There are various differences between the permission checking
112 in BSD-type systems and System V-type systems.
113 See the POSIX rationale for
115 A difference not mentioned by POSIX concerns the return
118 BSD documents that no signal is sent and
120 returned when the permission check failed for at least one target process,
121 while POSIX documents
123 only when the permission check failed for all target processes.
127 is implemented as a library function that makes the call
128 .IR "kill(-pgrp,\ sig)" .
133 .BR capabilities (7),