1KILLPG(3) Linux Programmer's Manual KILLPG(3)
2
3
4
6 killpg - send signal to a process group
7
9 #include <signal.h>
10
11 int killpg(int pgrp, int sig);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 killpg():
16 _XOPEN_SOURCE >= 500
17 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
18 || /* Glibc versions <= 2.19: */ _BSD_SOURCE
19
21 killpg() sends the signal sig to the process group pgrp. See signal(7)
22 for a list of signals.
23
24 If pgrp is 0, killpg() sends the signal to the calling process's
25 process group. (POSIX says: if pgrp is less than or equal to 1, the
26 behavior is undefined.)
27
28 For the permissions required to send a signal to another process, see
29 kill(2).
30
32 On success, zero is returned. On error, -1 is returned, and errno is
33 set appropriately.
34
36 EINVAL sig is not a valid signal number.
37
38 EPERM The process does not have permission to send the signal to any
39 of the target processes. For the required permissions, see
40 kill(2).
41
42 ESRCH No process can be found in the process group specified by pgrp.
43
44 ESRCH The process group was given as 0 but the sending process does
45 not have a process group.
46
48 POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD (killpg() first appeared in
49 4BSD).
50
52 There are various differences between the permission checking in BSD-
53 type systems and System V-type systems. See the POSIX rationale for
54 kill(3p). A difference not mentioned by POSIX concerns the return
55 value EPERM: BSD documents that no signal is sent and EPERM returned
56 when the permission check failed for at least one target process, while
57 POSIX documents EPERM only when the permission check failed for all
58 target processes.
59
60 C library/kernel differences
61 On Linux, killpg() is implemented as a library function that makes the
62 call kill(-pgrp, sig).
63
65 getpgrp(2), kill(2), signal(2), capabilities(7), credentials(7)
66
68 This page is part of release 5.10 of the Linux man-pages project. A
69 description of the project, information about reporting bugs, and the
70 latest version of this page, can be found at
71 https://www.kernel.org/doc/man-pages/.
72
73
74
75Linux 2020-06-09 KILLPG(3)