mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
std.os.linux: block all signals in raise
This commit is contained in:
parent
06fc600aec
commit
d128f5c0bb
@ -722,9 +722,12 @@ pub fn raise(sig: u8) RaiseError!void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (native_os == .linux) {
|
if (native_os == .linux) {
|
||||||
|
// https://git.musl-libc.org/cgit/musl/commit/?id=0bed7e0acfd34e3fb63ca0e4d99b7592571355a9
|
||||||
|
//
|
||||||
|
// Unlike musl, libc-less Zig std does not have any internal signals for implementation purposes, so we
|
||||||
|
// need to block all signals on the assumption that any of them could potentially fork() in a handler.
|
||||||
var set: sigset_t = undefined;
|
var set: sigset_t = undefined;
|
||||||
// block application signals
|
sigprocmask(SIG.BLOCK, &linux.all_mask, &set);
|
||||||
sigprocmask(SIG.BLOCK, &linux.app_mask, &set);
|
|
||||||
|
|
||||||
const tid = linux.gettid();
|
const tid = linux.gettid();
|
||||||
const rc = linux.tkill(tid, sig);
|
const rc = linux.tkill(tid, sig);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user