Skip to main content

is_process_running

Function is_process_running 

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

Check whether a process with the given PID is running.

On Unix, sends signal 0 (a no-op signal that checks process existence). On non-Unix platforms, always returns false.

Args:

  • pid: Process ID to check.

Usage:

if is_process_running(pid) {
    println!("Process {} is alive", pid);
}