Skip to content

Commit 5aff6cd

Browse files
committed
Add test for kill 0
1 parent 9781e02 commit 5aff6cd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/std/posix/test.zig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,3 +980,12 @@ const CommonOpenFlags = packed struct {
980980
return result;
981981
}
982982
};
983+
984+
test "kill 0 can be used to perform checks of sending signal" {
985+
if (native_os == .wasi) return error.SkipZigTest;
986+
if (native_os == .windows) return error.SkipZigTest;
987+
posix.kill(posix.getpid(), .INVAL) catch |err| switch (err) {
988+
posix.KillError.PermissionDenied => return,
989+
else => return err,
990+
};
991+
}

0 commit comments

Comments
 (0)