1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Purpose: Share child-process group isolation helpers across subprocess launchers.
//!
//! Responsibilities:
//! - Attach `std::process::Command` values to a dedicated Unix process group.
//! - Centralize the `pre_exec` safety invariant for `setpgid(0, 0)` launch hooks.
//! - Compile as a no-op on non-Unix platforms so shared call sites stay simple.
//!
//! Scope:
//! - Child process-group setup only.
//!
//! Usage:
//! - Called by managed shell execution, runner execution, and parallel worker spawning.
//!
//! Invariants/Assumptions:
//! - Unix callers want the child to become the leader of a fresh process group.
//! - The `pre_exec` closure must remain async-signal-safe and must not touch shared Rust state.
use Command;
use CommandExt;
pub