Deliver a signal to some subset of the descendants of the reaper. # References - [FreeBSD: `procctl(PROC_REAP_KILL,…)`] [FreeBSD: `procctl(PROC_REAP_KILL,…)`]: https://man.freebsd.org/cgi/man.cgi?query=procctl&sektion=2
(
process: ProcSelector,
signal: Signal,
direct_children: bool,
subtree: Option<Pid>,
)
| 423 | /// |
| 424 | /// [FreeBSD: `procctl(PROC_REAP_KILL,…)`]: https://man.freebsd.org/cgi/man.cgi?query=procctl&sektion=2 |
| 425 | pub fn reaper_kill( |
| 426 | process: ProcSelector, |
| 427 | signal: Signal, |
| 428 | direct_children: bool, |
| 429 | subtree: Option<Pid>, |
| 430 | ) -> io::Result<KillResult> { |
| 431 | let mut flags = KillFlags::empty(); |
| 432 | flags.set(KillFlags::CHILDREN, direct_children); |
| 433 | flags.set(KillFlags::SUBTREE, subtree.is_some()); |
| 434 | let mut req = procctl_reaper_kill { |
| 435 | rk_sig: signal.as_raw(), |
| 436 | rk_flags: flags.bits(), |
| 437 | rk_subtree: subtree.map(|p| p.as_raw_nonzero().into()).unwrap_or(0), |
| 438 | rk_killed: 0, |
| 439 | rk_fpid: 0, |
| 440 | rk_pad0: [0; 15], |
| 441 | }; |
| 442 | unsafe { procctl(PROC_REAP_KILL, process, as_mut_ptr(&mut req).cast())? }; |
| 443 | Ok(KillResult { |
| 444 | killed: req.rk_killed as _, |
| 445 | first_failed: Pid::from_raw(req.rk_fpid), |
| 446 | }) |
| 447 | } |
| 448 | |
| 449 | // |
| 450 | // PROC_TRAPCAP_STATUS/PROC_TRAPCAP_CTL |
nothing calls this directly
no test coverage detected