]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man3/killpg.3
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man3 / killpg.3
CommitLineData
fea681da
MK
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
47009d5e 4.\" SPDX-License-Identifier: BSD-4-Clause-UC
fea681da
MK
5.\"
6.\" @(#)killpg.2 6.5 (Berkeley) 3/10/91
7.\"
8.\" Modified Fri Jul 23 21:55:01 1993 by Rik Faith <faith@cs.unc.edu>
9.\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
c11b1abf 10.\" Modified 2004-06-16 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 11.\" Added notes on CAP_KILL
c13182ef 12.\" Modified 2004-06-21 by aeb
fea681da 13.\"
4c1c5274 14.TH killpg 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
15.SH NAME
16killpg \- send signal to a process group
d27ce174
AC
17.SH LIBRARY
18Standard C library
8fc3b2cf 19.RI ( libc ", " \-lc )
fea681da 20.SH SYNOPSIS
c7db92b9 21.nf
fea681da 22.B #include <signal.h>
c6d039a3 23.P
fea681da 24.BI "int killpg(int " pgrp ", int " sig );
c7db92b9 25.fi
c6d039a3 26.P
d39ad78f 27.RS -4
cc4615cc
MK
28Feature Test Macro Requirements for glibc (see
29.BR feature_test_macros (7)):
d39ad78f 30.RE
c6d039a3 31.P
cc4615cc 32.BR killpg ():
9d2adbae 33.nf
5c10d2c5
MK
34 _XOPEN_SOURCE >= 500
35.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
9d2adbae 36 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
75c018a1 37 || /* glibc <= 2.19: */ _BSD_SOURCE
9d2adbae 38.fi
fea681da 39.SH DESCRIPTION
7145b9a9 40.BR killpg ()
fea681da
MK
41sends the signal
42.I sig
43to the process group
44.IR pgrp .
45See
46.BR signal (7)
47for a list of signals.
c6d039a3 48.P
fea681da
MK
49If
50.I pgrp
51is 0,
e511ffb6 52.BR killpg ()
7dbfafa8 53sends the signal to the calling process's process group.
f64cc745 54(POSIX says: if
fea681da 55.I pgrp
d9bfdb9c 56is less than or equal to 1, the behavior is undefined.)
c6d039a3 57.P
6fee0ca3
MK
58For the permissions required to send a signal to another process, see
59.BR kill (2).
47297adb 60.SH RETURN VALUE
c13182ef
MK
61On success, zero is returned.
62On error, \-1 is returned, and
fea681da 63.I errno
f6a4078b 64is set to indicate the error.
fea681da
MK
65.SH ERRORS
66.TP
67.B EINVAL
d1ac81cf 68.I sig
fea681da
MK
69is not a valid signal number.
70.TP
71.B EPERM
72The process does not have permission to send the signal
73to any of the target processes.
6fee0ca3
MK
74For the required permissions, see
75.BR kill (2).
fea681da
MK
76.TP
77.B ESRCH
78No process can be found in the process group specified by
79.IR pgrp .
80.TP
81.B ESRCH
82The process group was given as 0 but the sending process does not
83have a process group.
4131356c 84.SH VERSIONS
fea681da 85There are various differences between the permission checking
efbfd7ec 86in BSD-type systems and System\ V-type systems.
0bfa087b 87See the POSIX rationale for
e3a78ee9 88.BR kill (3p).
b5cc2ffb 89A difference not mentioned by POSIX concerns the return
682edefb
MK
90value
91.BR EPERM :
92BSD documents that no signal is sent and
0daa9e92 93.B EPERM
682edefb
MK
94returned when the permission check failed for at least one target process,
95while POSIX documents
96.B EPERM
97only when the permission check failed for all target processes.
0722a578 98.SS C library/kernel differences
4a6515ef
MK
99On Linux,
100.BR killpg ()
101is implemented as a library function that makes the call
cd415e73 102.IR "kill(\-pgrp,\ sig)" .
4131356c
AC
103.SH STANDARDS
104POSIX.1-2008.
105.SH HISTORY
106POSIX.1-2001, SVr4, 4.4BSD
107(first appeared in 4BSD).
47297adb 108.SH SEE ALSO
fea681da
MK
109.BR getpgrp (2),
110.BR kill (2),
111.BR signal (2),
53a1443c
MK
112.BR capabilities (7),
113.BR credentials (7)