my previous version was wrong; this one is right
[unix-history] / usr / src / lib / libc / compat-43 / killpg.2
CommitLineData
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 20sends the signal
931b8415 21.Fa sig
040e2838 22to the process group
931b8415 23.Fa pgrp .
a4eea337 24See
931b8415 25.Xr sigaction 2
040e2838 26for a list of signals.
931b8415
CL
27If
28.Fa pgrp
29is 0,
30.Fn killpg
31sends the signal to the sending process's process group.
32.Pp
a4eea337 33The sending process and members of the process group must
3fa31615
MK
34have the same effective user ID, or
35the sender must be the super-user.
a4eea337 36As a single special case the continue signal SIGCONT may be sent
24c3ab84 37to any process that is a descendant of the current process.
931b8415 38.Sh RETURN VALUES
040e2838 39Upon successful completion, a value of 0 is returned. Otherwise,
931b8415
CL
40a value of -1 is returned and the global variable
41.Va errno
040e2838 42is set to indicate the error.
931b8415
CL
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
3fa31615
MK
54The process group was given as 0
55but the sending process does not have a process group.
931b8415 56.It Bq Er EPERM
040e2838
KM
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.
931b8415
CL
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 .