Skip to main content

process_alive

Function process_alive 

Source
pub fn process_alive(pid: u32) -> bool
Expand description

True iff pid is alive.

  • Linux: /proc/<pid> exists (no fork, no shell-out).
  • macOS / BSD: kill -0 <pid> (signal 0 = check only).
  • Windows: tasklist /FI "PID eq <pid>" /FO CSV /NH. A miss prints INFO: No tasks are running... to stdout AND exits 0, so we detect by content rather than exit code.