-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.16.0-dev.1424+d3e20e71b
Steps to Reproduce and Observed Behavior
From man 2 kill
If sig is 0, then no signal is sent, but existence and permission checks are still performed; this can be used to check for the existence of a process ID or process group ID that the caller is permitted to signal.
Since zig 0.16 is converting signal to exhaustive enum, the signal 0 is not allowed, so I was unable to migrate a function (without examining kill implementaion and reimplementing with syscall that is used internally)
fn pidIsRunning(pid: std.c.pid_t) !bool {
const Err = std.posix.KillError;
std.posix.kill(pid, 0) catch |err| switch (err) {
Err.PermissionDenied => return true,
Err.ProcessNotFound => return false,
Err.Unexpected => return err,
};
return true;
}Expected Behavior
Signal 0 should be allowed in kill to skip sending signal.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior