std: fix definition of SIG_IGN, SIG_DFL, etc.

POSIX specifies that the sa_handler field of the sigaction struct may
be set to SIG_IGN or SIG_DFL. However, the current constants in the
standard library use the function pointer signature corresponding to
the sa_sigaction field instead.

This may not cause issues in practice because the fields usually occupy
the same memory in a union, but this isn't required by POSIX and there
may be systems we do not yet support that do this differently.

Fixing this also makes the Zig interface less confusing to use after
reading the man page.
This commit is contained in:
Isaac Freund
2022-08-11 10:56:21 +02:00
parent 7d6a7f513b
commit b78f3bf1f1
10 changed files with 34 additions and 34 deletions

View File

@@ -1787,7 +1787,7 @@ fn resetSegfaultHandler() void {
return;
}
var act = os.Sigaction{
.handler = .{ .sigaction = os.SIG.DFL },
.handler = .{ .handler = os.SIG.DFL },
.mask = os.empty_sigset,
.flags = 0,
};