authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2020-10-24 19:52:52+07:00
committergravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2020-10-24 20:05:34+07:00
logcdbf66e36ec110993347e5158005ec1cc0adaf13
tree29bb2031e9db5c293b4582e2e05925be9e1fced8
parent268516d5d90cfb183a4986e7e04b05b41c3dd1e0

Add sparc64-specific values for the various SA_ and SIG_ constants


2 files changed, 18 insertions(+), 3 deletions(-)

lib/std/os/bits/linux.zig+17-2
......@@ -31,6 +31,7 @@ pub usingnamespace @import("linux/securebits.zig");
3131
3232const is_mips = builtin.arch.isMIPS();
3333const is_ppc64 = builtin.arch.isPPC64();
34const is_sparc = builtin.arch.isSPARC();
3435
3536pub const pid_t = i32;
3637pub const fd_t = i32;
......@@ -183,16 +184,32 @@ pub usingnamespace if (is_mips)
183184 pub const SA_NOCLDSTOP = 1;
184185 pub const SA_NOCLDWAIT = 0x10000;
185186 pub const SA_SIGINFO = 8;
187 pub const SA_RESTART = 0x10000000;
188 pub const SA_RESETHAND = 0x80000000;
186189
187190 pub const SIG_BLOCK = 1;
188191 pub const SIG_UNBLOCK = 2;
189192 pub const SIG_SETMASK = 3;
190193 }
194else if (is_sparc)
195 struct {
196 pub const SA_NOCLDSTOP = 1;
197 pub const SA_NOCLDWAIT = 2;
198 pub const SA_SIGINFO = 0x200;
199 pub const SA_RESTART = 0x2;
200 pub const SA_RESETHAND = 0x4;
201
202 pub const SIG_BLOCK = 0;
203 pub const SIG_UNBLOCK = 1;
204 pub const SIG_SETMASK = 2;
205 }
191206else
192207 struct {
193208 pub const SA_NOCLDSTOP = 1;
194209 pub const SA_NOCLDWAIT = 2;
195210 pub const SA_SIGINFO = 4;
211 pub const SA_RESTART = 0x10000000;
212 pub const SA_RESETHAND = 0x80000000;
196213
197214 pub const SIG_BLOCK = 0;
198215 pub const SIG_UNBLOCK = 1;
......@@ -200,9 +217,7 @@ else
200217 };
201218
202219pub const SA_ONSTACK = 0x08000000;
203pub const SA_RESTART = 0x10000000;
204220pub const SA_NODEFER = 0x40000000;
205pub const SA_RESETHAND = 0x80000000;
206221pub const SA_RESTORER = 0x04000000;
207222
208223pub const SIGHUP = 1;
lib/std/target.zig+1-1
......@@ -763,7 +763,7 @@ pub const Target = struct {
763763
764764 pub fn isSPARC(arch: Arch) bool {
765765 return switch (arch) {
766 .sparcv8, .sparcv9 => true,
766 .sparc, .sparcel, .sparcv9 => true,
767767 else => false,
768768 };
769769 }