MCPcopy Create free account
hub / github.com/block/buzz / process_is_running

Function process_is_running

desktop/src-tauri/src/managed_agents/runtime.rs:75–81  ·  view source on GitHub ↗
(pid: u32)

Source from the content-addressed store, hash-verified

73
74#[cfg(unix)]
75pub(crate) fn process_is_running(pid: u32) -> bool {
76 // Use libc::kill with signal 0 instead of forking a subprocess.
77 // Returns true only if the process exists AND we can signal it.
78 // Returns false for non-existent PIDs (ESRCH) and PIDs owned by
79 // other users (EPERM) — callers should not interact with those.
80 unsafe { libc::kill(pid as i32, 0) == 0 }
81}
82
83#[cfg(not(unix))]
84pub(crate) fn process_is_running(_pid: u32) -> bool {

Calls

no outgoing calls

Tested by

no test coverage detected