killpg(3) -- Linux man page
NAMEkillpg - send signal to all members of a process group
#include <signal.h> int killpg(pid_t pidgrp, int signal);
DESCRIPTIONThe killpg() function causes signal signal to be sent to all the processes in the process group pidgrp or to the processes' own process group if pidgrp is equal to zero.
It is equivalent to
RETURN VALUEThe value returned is -1 on error, or 0 for success.
ERRORSErrors are returned in errno and can be one of the following:
- for an invalid signal,
- for a process group which does not exist, and
- if the userid of the calling process is not equal to that of the process the signal is sent to, and the userid is not that of the superuser.
SEE ALSOkill(2), signal(2), signal(7)