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");...@@ -31,6 +31,7 @@ pub usingnamespace @import("linux/securebits.zig");
3131
32const is_mips = builtin.arch.isMIPS();32const is_mips = builtin.arch.isMIPS();
33const is_ppc64 = builtin.arch.isPPC64();33const is_ppc64 = builtin.arch.isPPC64();
34const is_sparc = builtin.arch.isSPARC();
3435
35pub const pid_t = i32;36pub const pid_t = i32;
36pub const fd_t = i32;37pub const fd_t = i32;
...@@ -183,16 +184,32 @@ pub usingnamespace if (is_mips)...@@ -183,16 +184,32 @@ pub usingnamespace if (is_mips)
183 pub const SA_NOCLDSTOP = 1;184 pub const SA_NOCLDSTOP = 1;
184 pub const SA_NOCLDWAIT = 0x10000;185 pub const SA_NOCLDWAIT = 0x10000;
185 pub const SA_SIGINFO = 8;186 pub const SA_SIGINFO = 8;
187 pub const SA_RESTART = 0x10000000;
188 pub const SA_RESETHAND = 0x80000000;
186189
187 pub const SIG_BLOCK = 1;190 pub const SIG_BLOCK = 1;
188 pub const SIG_UNBLOCK = 2;191 pub const SIG_UNBLOCK = 2;
189 pub const SIG_SETMASK = 3;192 pub const SIG_SETMASK = 3;
190 }193 }
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 }
191else206else
192 struct {207 struct {
193 pub const SA_NOCLDSTOP = 1;208 pub const SA_NOCLDSTOP = 1;
194 pub const SA_NOCLDWAIT = 2;209 pub const SA_NOCLDWAIT = 2;
195 pub const SA_SIGINFO = 4;210 pub const SA_SIGINFO = 4;
211 pub const SA_RESTART = 0x10000000;
212 pub const SA_RESETHAND = 0x80000000;
196213
197 pub const SIG_BLOCK = 0;214 pub const SIG_BLOCK = 0;
198 pub const SIG_UNBLOCK = 1;215 pub const SIG_UNBLOCK = 1;
...@@ -200,9 +217,7 @@ else...@@ -200,9 +217,7 @@ else
200 };217 };
201218
202pub const SA_ONSTACK = 0x08000000;219pub const SA_ONSTACK = 0x08000000;
203pub const SA_RESTART = 0x10000000;
204pub const SA_NODEFER = 0x40000000;220pub const SA_NODEFER = 0x40000000;
205pub const SA_RESETHAND = 0x80000000;
206pub const SA_RESTORER = 0x04000000;221pub const SA_RESTORER = 0x04000000;
207222
208pub const SIGHUP = 1;223pub const SIGHUP = 1;
lib/std/target.zig+1-1
...@@ -763,7 +763,7 @@ pub const Target = struct {...@@ -763,7 +763,7 @@ pub const Target = struct {
763763
764 pub fn isSPARC(arch: Arch) bool {764 pub fn isSPARC(arch: Arch) bool {
765 return switch (arch) {765 return switch (arch) {
766 .sparcv8, .sparcv9 => true,766 .sparc, .sparcel, .sparcv9 => true,
767 else => false,767 else => false,
768 };768 };
769 }769 }