killpg(2) CLIX killpg(2)
NAME
killpg - Sends signal to a process group
LIBRARY
Berkeley Software Distribution Library (libbsd.a)
SYNOPSIS
int killpg(
int pgrp ,
int sig );
PARAMETERS
pgrp Identifies the process group whose members are to be sent the
signal.
sig Specifies the signal to send.
DESCRIPTION
The killpg() function sends the signal sig to the process group pgrp. See
signal() for a list of signals.
The sending process and members of the process group must have the same
effective user ID, or the sender must be the superuser. As a special
case, the continue signal SIGCONT may be sent to any process that is a
descendant of the current process.
EXAMPLES
To send a SIGUSR1 to all members of a process group:
if (killpg(pgrp, SIGUSR1) == -1)
perror("killpg failed");
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value
of -1 is returned and the global variable errno is set to indicate the
error.
ERRORS
The killpg() function fails and no signal is sent if any of the following
occurs:
[EINVAL] The sig parameter is not a valid signal number, or sig is
2/94 - Intergraph Corporation 1
killpg(2) CLIX killpg(2)
SIGKILL and pgrp is 1 (process 1).
[ESRCH] No process can be found in the process group specified by pgrp.
[EPERM] The sending process is not the superuser, and one or more of
the target processes has an effective user ID different from
that of the sending process.
RELATED INFORMATION
Functions: signal(2), kill(2), getpgrp(2)
2 Intergraph Corporation - 2/94