1KILLPG(3P) POSIX Programmer's Manual KILLPG(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 killpg — send a signal to a process group
13
15 #include <signal.h>
16
17 int killpg(pid_t pgrp, int sig);
18
20 The killpg() function shall send the signal specified by sig to the
21 process group specified by pgrp.
22
23 If pgrp is greater than 1, killpg(pgrp, sig) shall be equivalent to
24 kill(-pgrp, sig). If pgrp is less than or equal to 1, the behavior of
25 killpg() is undefined.
26
28 Refer to kill().
29
31 Refer to kill().
32
33 The following sections are informative.
34
36 Sending a Signal to All Other Members of a Process Group
37 The following example shows how the calling process could send a signal
38 to all other members of its process group. To prevent itself from
39 receiving the signal it first makes itself immune to the signal by
40 ignoring it.
41
42
43 #include <signal.h>
44 #include <unistd.h>
45 ...
46 if (signal(SIGUSR1, SIG_IGN) == SIG_ERR)
47 /* Handle error */;
48
49 if (killpg(getpgrp(), SIGUSR1) == -1)
50 /* Handle error */;"
51
53 None.
54
56 None.
57
59 None.
60
62 getpgid(), getpid(), kill(), raise()
63
64 The Base Definitions volume of POSIX.1‐2017, <signal.h>
65
67 Portions of this text are reprinted and reproduced in electronic form
68 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
69 table Operating System Interface (POSIX), The Open Group Base Specifi‐
70 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
71 Electrical and Electronics Engineers, Inc and The Open Group. In the
72 event of any discrepancy between this version and the original IEEE and
73 The Open Group Standard, the original IEEE and The Open Group Standard
74 is the referee document. The original Standard can be obtained online
75 at http://www.opengroup.org/unix/online.html .
76
77 Any typographical or formatting errors that appear in this page are
78 most likely to have been introduced during the conversion of the source
79 files to man page format. To report such errors, see https://www.ker‐
80 nel.org/doc/man-pages/reporting_bugs.html .
81
82
83
84IEEE/The Open Group 2017 KILLPG(3P)