Skip to main content

kill_process_group

Function kill_process_group 

Source
pub fn kill_process_group(pgid: u32) -> Result<()>
Expand description

Send SIGKILL to the process group pgid directly — no lookup through the leader pid. This is the form that still reaches a group’s surviving members after the leader exited and was reaped: kill_by_pid’s getpgid resolution returns ESRCH then and silently spares them. A fully-gone group reads as success. Groups 0 and 1 are rejected rather than signalled: to killpg they mean the caller’s own group and init’s.

Signals the group id, not the job that created it: a caller holding a pgid past its group’s death accepts the same theoretical recycled-pgid exposure as a manual kill -- -<pgid>.