authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-12-22 13:00:16+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-12-22 20:20:53+11:00
log9577ff1c904daf7384197b3ee84923bdc18afc28
tree4cb7e45315c4988ba0d18bd280bd3aa83910469f
parent96c9c38b350d6ab456801e53c7fe1fa2a205f5b2
signature Commit is signed but in an unrecognized format.

std: use simpler sigset_t definition


1 files changed, 7 insertions(+), 12 deletions(-)

lib/std/os/bits/linux.zig+7-12
......@@ -764,19 +764,14 @@ pub const winsize = extern struct {
764764 ws_ypixel: u16,
765765};
766766
767/// NSIG is the total number of signals defined.
768/// As signal numbers are sequential, NSIG is one greater than the largest defined signal number.
767769pub const NSIG = if (is_mips) 128 else 65;
768pub const sigset_t = [128 / @sizeOf(usize)]usize;
769770
770pub usingnamespace if (NSIG == 65)
771 struct {
772 pub const all_mask = [2]u32{ 0xffffffff, 0xffffffff };
773 pub const app_mask = [2]u32{ 0xfffffffc, 0x7fffffff };
774 }
775else
776 struct {
777 pub const all_mask = [4]u32{ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff };
778 pub const app_mask = [4]u32{ 0xfffffffc, 0x7fffffff, 0xffffffff, 0xffffffff };
779 };
771pub const sigset_t = [1024 / 32]u32;
772
773pub const all_mask: sigset_t = [_]u32{0xffffffff} ** sigset_t.len;
774pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffffffff} ** 30;
780775
781776pub const k_sigaction = if (is_mips)
782777 extern struct {
......@@ -804,7 +799,7 @@ pub const Sigaction = extern struct {
804799pub const SIG_ERR = @intToPtr(extern fn (i32, *siginfo_t, *c_void) void, maxInt(usize));
805800pub const SIG_DFL = @intToPtr(?extern fn (i32, *siginfo_t, *c_void) void, 0);
806801pub const SIG_IGN = @intToPtr(extern fn (i32, *siginfo_t, *c_void) void, 1);
807pub const empty_sigset = [_]usize{0} ** sigset_t.len;
802pub const empty_sigset = [_]u32{0} ** sigset_t.len;
808803
809804pub const in_port_t = u16;
810805pub const sa_family_t = u16;