Check whether a process with the given PID is currently running.
On Posix this uses kill(pid, 0): no signal is sent, but the kernel
validates whether the target process exists and the caller has permission
to signal it. ESRCH ("no such process") is the only errno value that
conclusively means the process is gone.
On Windows this opens a query handle via OpenProcess and reads the exit
code with GetExitCodeProcess. If the handle cannot be opened the
function returns false (process absent or inaccessible).
Check whether a process with the given PID is currently running.
On Posix this uses kill(pid, 0): no signal is sent, but the kernel validates whether the target process exists and the caller has permission to signal it. ESRCH ("no such process") is the only errno value that conclusively means the process is gone.
On Windows this opens a query handle via OpenProcess and reads the exit code with GetExitCodeProcess. If the handle cannot be opened the function returns false (process absent or inaccessible).