Commit | Line | Data |
---|---|---|
931b8415 | 1 | .\" Copyright (c) 1980, 1991 Regents of the University of California. |
0117641b | 2 | .\" All rights reserved. |
a4eea337 | 3 | .\" |
0117641b KB |
4 | .\" %sccs.include.redist.man% |
5 | .\" | |
931b8415 | 6 | .\" @(#)killpg.2 6.5 (Berkeley) %G% |
a4eea337 | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt KILLPG 2 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm killpg | |
13 | .Nd send signal to a process group | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/signal.h> | |
16 | .Ft int | |
17 | .Fn killpg "pid_t pgrp" "int sig" | |
18 | .Sh DESCRIPTION | |
19 | .Fn Killpg | |
a4eea337 | 20 | sends the signal |
931b8415 | 21 | .Fa sig |
040e2838 | 22 | to the process group |
931b8415 | 23 | .Fa pgrp . |
a4eea337 | 24 | See |
931b8415 | 25 | .Xr sigaction 2 |
040e2838 | 26 | for a list of signals. |
931b8415 CL |
27 | If |
28 | .Fa pgrp | |
29 | is 0, | |
30 | .Fn killpg | |
31 | sends the signal to the sending process's process group. | |
32 | .Pp | |
a4eea337 | 33 | The sending process and members of the process group must |
3fa31615 MK |
34 | have the same effective user ID, or |
35 | the sender must be the super-user. | |
a4eea337 | 36 | As a single special case the continue signal SIGCONT may be sent |
24c3ab84 | 37 | to any process that is a descendant of the current process. |
931b8415 | 38 | .Sh RETURN VALUES |
040e2838 | 39 | Upon successful completion, a value of 0 is returned. Otherwise, |
931b8415 CL |
40 | a value of -1 is returned and the global variable |
41 | .Va errno | |
040e2838 | 42 | is set to indicate the error. |
931b8415 CL |
43 | .Sh ERRORS |
44 | .Fn Killpg | |
45 | will fail and no signal will be sent if: | |
46 | .Bl -tag -width Er | |
47 | .It Bq Er EINVAL | |
48 | .Fa Sig | |
49 | is not a valid signal number. | |
50 | .It Bq Er ESRCH | |
51 | No process can be found in the process group specified by | |
52 | .Fa pgrp . | |
53 | .It Bq Er ESRCH | |
3fa31615 MK |
54 | The process group was given as 0 |
55 | but the sending process does not have a process group. | |
931b8415 | 56 | .It Bq Er EPERM |
040e2838 KM |
57 | The sending process is not the super-user and one or more |
58 | of the target processes has an effective user ID different from that | |
59 | of the sending process. | |
931b8415 CL |
60 | .El |
61 | .Sh SEE ALSO | |
62 | .Xr kill 2 , | |
63 | .Xr getpgrp 2 , | |
64 | .Xr sigaction 2 | |
65 | .Sh HISTORY | |
66 | The | |
67 | .Nm | |
68 | function call appeared in | |
69 | .Bx 4.0 . |