1KILLPG(3P)                 POSIX Programmer's Manual                KILLPG(3P)
2
3
4

PROLOG

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
11

NAME

13       killpg — send a signal to a process group
14

SYNOPSIS

16       #include <signal.h>
17
18       int killpg(pid_t pgrp, int sig);
19

DESCRIPTION

21       The killpg() function shall send the signal specified  by  sig  to  the
22       process group specified by pgrp.
23
24       If  pgrp  is  greater  than 1, killpg(pgrp, sig) shall be equivalent to
25       kill(−pgrp, sig). If pgrp is less than or equal to 1, the  behavior  of
26       killpg() is undefined.
27

RETURN VALUE

29       Refer to kill().
30

ERRORS

32       Refer to kill().
33
34       The following sections are informative.
35

EXAMPLES

37   Sending a Signal to All Other Members of a Process Group
38       The following example shows how the calling process could send a signal
39       to all other members of its  process  group.  To  prevent  itself  from
40       receiving  the  signal  it  first  makes itself immune to the signal by
41       ignoring it.
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

APPLICATION USAGE

53       None.
54

RATIONALE

56       None.
57

FUTURE DIRECTIONS

59       None.
60

SEE ALSO

62       getpgid(), getpid(), kill(), raise()
63
64       The Base Definitions volume of POSIX.1‐2008, <signal.h>
65
67       Portions of this text are reprinted and reproduced in  electronic  form
68       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
69       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
70       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
71       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
72       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
73       event of any discrepancy between this version and the original IEEE and
74       The  Open Group Standard, the original IEEE and The Open Group Standard
75       is the referee document. The original Standard can be  obtained  online
76       at http://www.unix.org/online.html .
77
78       Any  typographical  or  formatting  errors that appear in this page are
79       most likely to have been introduced during the conversion of the source
80       files  to  man page format. To report such errors, see https://www.ker
81       nel.org/doc/man-pages/reporting_bugs.html .
82
83
84
85IEEE/The Open Group                  2013                           KILLPG(3P)
Impressum