killpg
Killpg is a Unix and Unix-like system interface function that sends a specified signal to all processes in a given process group. It is used to manage or terminate multi-process jobs that share a common process group, such as a pipeline or a script spawning several child processes.
The function typically has the signature int killpg(pid_t pgrp, int sig); and is declared in the system’s
Portability and availability vary by platform. Not all systems provide killpg as a separate entry in the
Typical use cases include terminating all processes in a job started by a script, sending a gentle