197 lines
4.4 KiB
HTML
197 lines
4.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of KILLPG</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>KILLPG</H1>
|
|
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
killpg - send signal to a process group
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/signal.h">signal.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<B>int killpg(int </B><I>pgrp</I><B>, int </B><I>sig</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
<B><A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A></B>(7)):
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>killpg</B>():
|
|
|
|
<DD>
|
|
_XOPEN_SOURCE >= 500
|
|
|
|
<BR> || /* Since glibc 2.19: */ _DEFAULT_SOURCE
|
|
<BR> || /* Glibc versions <= 2.19: */ _BSD_SOURCE
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>killpg</B>()
|
|
|
|
sends the signal
|
|
<I>sig</I>
|
|
|
|
to the process group
|
|
<I>pgrp</I>.
|
|
|
|
See
|
|
<B><A HREF="/cgi-bin/man/man2html?7+signal">signal</A></B>(7)
|
|
|
|
for a list of signals.
|
|
<P>
|
|
|
|
If
|
|
<I>pgrp</I>
|
|
|
|
is 0,
|
|
<B>killpg</B>()
|
|
|
|
sends the signal to the calling process's process group.
|
|
(POSIX says: if
|
|
<I>pgrp</I>
|
|
|
|
is less than or equal to 1, the behavior is undefined.)
|
|
<P>
|
|
|
|
For the permissions required to send a signal to another process, see
|
|
<B><A HREF="/cgi-bin/man/man2html?2+kill">kill</A></B>(2).
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
On success, zero is returned.
|
|
On error, -1 is returned, and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
<I>sig</I>
|
|
|
|
is not a valid signal number.
|
|
<DT id="3"><B>EPERM</B>
|
|
|
|
<DD>
|
|
The process does not have permission to send the signal
|
|
to any of the target processes.
|
|
For the required permissions, see
|
|
<B><A HREF="/cgi-bin/man/man2html?2+kill">kill</A></B>(2).
|
|
|
|
<DT id="4"><B>ESRCH</B>
|
|
|
|
<DD>
|
|
No process can be found in the process group specified by
|
|
<I>pgrp</I>.
|
|
|
|
<DT id="5"><B>ESRCH</B>
|
|
|
|
<DD>
|
|
The process group was given as 0 but the sending process does not
|
|
have a process group.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD
|
|
(<B>killpg</B>()
|
|
|
|
first appeared in 4BSD).
|
|
<A NAME="lbAH"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
There are various differences between the permission checking
|
|
in BSD-type systems and System V-type systems.
|
|
See the POSIX rationale for
|
|
<B>kill</B>().
|
|
|
|
A difference not mentioned by POSIX concerns the return
|
|
value
|
|
<B>EPERM</B>:
|
|
|
|
BSD documents that no signal is sent and
|
|
<B>EPERM</B>
|
|
|
|
returned when the permission check failed for at least one target process,
|
|
while POSIX documents
|
|
<B>EPERM</B>
|
|
|
|
only when the permission check failed for all target processes.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>C library/kernel differences</H3>
|
|
|
|
On Linux,
|
|
<B>killpg</B>()
|
|
|
|
is implemented as a library function that makes the call
|
|
<I>kill(-pgrp, sig)</I>.
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+getpgrp">getpgrp</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+kill">kill</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+signal">signal</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+capabilities">capabilities</A></B>(7),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+credentials">credentials</A></B>(7)
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="9"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="10"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="11"><A HREF="#lbAG">CONFORMING TO</A><DD>
|
|
<DT id="12"><A HREF="#lbAH">NOTES</A><DD>
|
|
<DL>
|
|
<DT id="13"><A HREF="#lbAI">C library/kernel differences</A><DD>
|
|
</DL>
|
|
<DT id="14"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
<DT id="15"><A HREF="#lbAK">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:46 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|