pub fn set_thread_affinity(pid: pid_t, cpus: &BTreeSet<usize>) -> Result<()>Expand description
Set per-thread CPU affinity via sched_setaffinity(2).
pid must be > 0 — pid <= 0 has broadcast semantics at the
syscall level (target the calling task or every task in a tgid
depending on layer) and is rejected up-front so no caller passes
an unchecked 0 through.