Skip to main content

kill_tree

Function kill_tree 

Source
pub fn kill_tree(pid: u32, timeout: Duration) -> Result<u32>
Expand description

Kill the process tree rooted at pid.

Returns the number of distinct process instances for which the OS accepted a kill request. A missing PID is a successful no-op. timeout bounds the post-signal wait and retry loop; the initial termination attempt always occurs even when the timeout is zero.

The tree is a point-in-time snapshot. A process created in the narrow race between enumeration and root termination can escape unless the caller also owns an OS containment primitive such as a Windows Job Object.