xref: /csrg-svn/lib/libc/compat-43/killpg.2 (revision 60986)
1*60986Sbostic.\" Copyright (c) 1980, 1991, 1993
2*60986Sbostic.\"	The Regents of the University of California.  All rights reserved.
320113Smckusick.\"
447041Sbostic.\" %sccs.include.redist.man%
520113Smckusick.\"
6*60986Sbostic.\"     @(#)killpg.2	8.1 (Berkeley) 06/02/93
747041Sbostic.\"
847209Scael.Dd
947209Scael.Dt KILLPG 2
1047209Scael.Os BSD 4
1147209Scael.Sh NAME
1247209Scael.Nm killpg
1347209Scael.Nd send signal to a process group
1447209Scael.Sh SYNOPSIS
1555755Sbostic.Fd #include <signal.h>
1647209Scael.Ft int
1747209Scael.Fn killpg "pid_t pgrp" "int sig"
1847209Scael.Sh DESCRIPTION
1947209Scael.Fn Killpg
2020113Smckusicksends the signal
2147209Scael.Fa sig
2220114Smckusickto the process group
2347209Scael.Fa pgrp .
2420113SmckusickSee
2547209Scael.Xr sigaction 2
2620114Smckusickfor a list of signals.
2747209ScaelIf
2847209Scael.Fa pgrp
2947209Scaelis 0,
3047209Scael.Fn killpg
3147209Scaelsends the signal to the sending process's process group.
3247209Scael.Pp
3320113SmckusickThe sending process and members of the process group must
3428107Skarelshave the same effective user ID, or
3528107Skarelsthe sender must be the super-user.
3620113SmckusickAs a single special case the continue signal SIGCONT may be sent
3723812Ssechrestto any process that is a descendant of the current process.
3847209Scael.Sh RETURN VALUES
3920114SmckusickUpon successful completion, a value of 0 is returned.  Otherwise,
4047209Scaela value of -1 is returned and the global variable
4147209Scael.Va errno
4220114Smckusickis set to indicate the error.
4347209Scael.Sh ERRORS
4447209Scael.Fn Killpg
4547209Scaelwill fail and no signal will be sent if:
4647209Scael.Bl -tag -width Er
4747209Scael.It Bq Er EINVAL
4847209Scael.Fa Sig
4947209Scaelis not a valid signal number.
5047209Scael.It Bq Er ESRCH
5147209ScaelNo process can be found in the process group specified by
5247209Scael.Fa pgrp .
5347209Scael.It Bq Er ESRCH
5428107SkarelsThe process group was given as 0
5528107Skarelsbut the sending process does not have a process group.
5647209Scael.It Bq Er EPERM
5720114SmckusickThe sending process is not the super-user and one or more
5820114Smckusickof the target processes has an effective user ID different from that
5920114Smckusickof the sending process.
6047209Scael.El
6147209Scael.Sh SEE ALSO
6247209Scael.Xr kill 2 ,
6347209Scael.Xr getpgrp 2 ,
6447209Scael.Xr sigaction 2
6547209Scael.Sh HISTORY
6647209ScaelThe
6747209Scael.Nm
6847209Scaelfunction call appeared in
6947209Scael.Bx 4.0 .
70