Skip to main content

wait_root

Function wait_root 

Source
fn wait_root(pid: i32) -> i32
Expand description

Waits for the first tracee and returns the exit code to report, reaping every other child along the way.

Without ptrace the first tracee is the supervisor’s own child and, with become_subreaper, so is every orphaned descendant. Once the first tracee is gone a thread keeps reaping until the process exits; the pool closes when no process uses the filter any more, the point at which the tracer loop would have run out of tracees.

§Arguments

  • pid - The first tracee.