KILLPG(2)
NAME
killpg − send signal to a process group
USAGE
killpg(pgrp, sig) int pgrp, sig;
DESCRIPTION
Killpg sends the signal sig to the process group pgrp. Sig must be one of the signals defined in sigvec(2).
The sending process and all processes in the process group must have the same effective user ID. The only exception is the signal SIGCONT, which killpg may always send to any child or grandchild of the current process. In all other cases, use of killpg is restricted to the super-user.
RETURN VALUE
A successful call returns zero. A failed call returns -1 and sets errno as indicated below.
ERRORS
Killpg will fail and no signal will be sent in any of the following cases:
[EINVAL] Sig is not a valid signal number.
[ESRCH] No process was found with the specified pid.
[EPERM] The sending process is not the super-user and one or more of the target processes has a different effective user ID than the sending process.