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@gmx.net>
37 .\" Added notes on CAP_KILL
38 .\" Modified 2004-06-21 by aeb
40 .TH KILLPG 2 2004-06-21 "BSD Man Page" "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 );
55 for a list of signals.
60 sends the signal to the sending process's process group.
64 is less than or equal to 1, the behaviour is undefined.)
66 For a process to have permission to send a signal
67 it must either be privileged (under Linux: have the
69 capability), or the real or effective
70 user ID of the sending process must equal the real or
71 saved set-user-ID of the target process.
72 In the case of SIGCONT it suffices when the sending and receiving
73 processes belong to the same session.
75 On success, zero is returned.
76 On error, \-1 is returned, and
83 is not a valid signal number.
86 The process does not have permission to send the signal
87 to any of the target processes.
90 No process can be found in the process group specified by
94 The process group was given as 0 but the sending process does not
97 There are various differences between the permission checking
98 in BSD-type systems and System V-type systems.
99 See the POSIX rationale
102 A difference not mentioned by POSIX concerns the return
103 value EPERM: BSD documents that no signal is sent and EPERM returned
104 when the permission check failed for at least one target process,
105 while POSIX documents EPERM only when the permission check failed
106 for all target processes.
110 function call first appeared in 4BSD), POSIX.1-2001.