xref: /original-bsd/lib/libc/compat-43/killpg.2 (revision d272e02a)
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)killpg.2	6.5 (Berkeley) 03/10/91
7.\"
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
20sends the signal
21.Fa sig
22to the process group
23.Fa pgrp .
24See
25.Xr sigaction 2
26for a list of signals.
27If
28.Fa pgrp
29is 0,
30.Fn killpg
31sends the signal to the sending process's process group.
32.Pp
33The sending process and members of the process group must
34have the same effective user ID, or
35the sender must be the super-user.
36As a single special case the continue signal SIGCONT may be sent
37to any process that is a descendant of the current process.
38.Sh RETURN VALUES
39Upon successful completion, a value of 0 is returned.  Otherwise,
40a value of -1 is returned and the global variable
41.Va errno
42is set to indicate the error.
43.Sh ERRORS
44.Fn Killpg
45will fail and no signal will be sent if:
46.Bl -tag -width Er
47.It Bq Er EINVAL
48.Fa Sig
49is not a valid signal number.
50.It Bq Er ESRCH
51No process can be found in the process group specified by
52.Fa pgrp .
53.It Bq Er ESRCH
54The process group was given as 0
55but the sending process does not have a process group.
56.It Bq Er EPERM
57The sending process is not the super-user and one or more
58of the target processes has an effective user ID different from that
59of the sending process.
60.El
61.Sh SEE ALSO
62.Xr kill 2 ,
63.Xr getpgrp 2 ,
64.Xr sigaction 2
65.Sh HISTORY
66The
67.Nm
68function call appeared in
69.Bx 4.0 .
70