Multi platform mechanism for getting error message from libc

This commit is contained in:
Christopher Dryden 2025-11-28 21:24:51 +00:00 committed by Chris Dryden
parent 647821684e
commit dd8b3090d2

View file

@ -72,8 +72,7 @@ pub fn pid_is_alive(pid: i32) -> bool {
if pid <= 0 {
return true;
}
unsafe { libc::kill(pid, 0) == 0 || *libc::__errno_location() != libc::ESRCH }
unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH }
}
/// `getsid()` returns the session ID of the process with process ID pid.