Skip to main content

confine_child

Function confine_child 

Source
pub fn confine_child(command: &mut Command, set: &CoreSet)
Expand description

Confine a not-yet-spawned child to set, launcher-side: a pre-exec hook (Linux) narrows the child’s initial thread to the set before exec, so every thread the child creates afterwards — runtime workers, blocking pools, RocksDB background compaction — inherits the mask, without any cooperation from the child binary. The set is also written into the child’s environment as an explicit spec so the child agrees with the launcher. The hook is best-effort: a sched_setaffinity failure (spec outside the child’s cpuset) is swallowed and the child keeps its inherited mask rather than failing the spawn.