diff options
| author | Koakuma <koachan@protonmail.com> | 2020-10-24 19:52:52 +0700 |
|---|---|---|
| committer | Koakuma <koachan@protonmail.com> | 2020-10-24 20:05:34 +0700 |
| commit | cdbf66e36ec110993347e5158005ec1cc0adaf13 (patch) | |
| tree | 29bb2031e9db5c293b4582e2e05925be9e1fced8 /lib/std | |
| parent | 268516d5d90cfb183a4986e7e04b05b41c3dd1e0 (diff) | |
| download | zig-cdbf66e36ec110993347e5158005ec1cc0adaf13.tar.gz zig-cdbf66e36ec110993347e5158005ec1cc0adaf13.zip | |
Add sparc64-specific values for the various SA_ and SIG_ constants
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os/bits/linux.zig | 19 | ||||
| -rw-r--r-- | lib/std/target.zig | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index ab9fe9ffb4..087f06672b 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -31,6 +31,7 @@ pub usingnamespace @import("linux/securebits.zig"); const is_mips = builtin.arch.isMIPS(); const is_ppc64 = builtin.arch.isPPC64(); +const is_sparc = builtin.arch.isSPARC(); pub const pid_t = i32; pub const fd_t = i32; @@ -183,16 +184,32 @@ pub usingnamespace if (is_mips) pub const SA_NOCLDSTOP = 1; pub const SA_NOCLDWAIT = 0x10000; pub const SA_SIGINFO = 8; + pub const SA_RESTART = 0x10000000; + pub const SA_RESETHAND = 0x80000000; pub const SIG_BLOCK = 1; pub const SIG_UNBLOCK = 2; pub const SIG_SETMASK = 3; } +else if (is_sparc) + struct { + pub const SA_NOCLDSTOP = 1; + pub const SA_NOCLDWAIT = 2; + pub const SA_SIGINFO = 0x200; + pub const SA_RESTART = 0x2; + pub const SA_RESETHAND = 0x4; + + pub const SIG_BLOCK = 0; + pub const SIG_UNBLOCK = 1; + pub const SIG_SETMASK = 2; + } else struct { pub const SA_NOCLDSTOP = 1; pub const SA_NOCLDWAIT = 2; pub const SA_SIGINFO = 4; + pub const SA_RESTART = 0x10000000; + pub const SA_RESETHAND = 0x80000000; pub const SIG_BLOCK = 0; pub const SIG_UNBLOCK = 1; @@ -200,9 +217,7 @@ else }; pub const SA_ONSTACK = 0x08000000; -pub const SA_RESTART = 0x10000000; pub const SA_NODEFER = 0x40000000; -pub const SA_RESETHAND = 0x80000000; pub const SA_RESTORER = 0x04000000; pub const SIGHUP = 1; diff --git a/lib/std/target.zig b/lib/std/target.zig index 66008ef6c2..45b182982a 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -763,7 +763,7 @@ pub const Target = struct { pub fn isSPARC(arch: Arch) bool { return switch (arch) { - .sparcv8, .sparcv9 => true, + .sparc, .sparcel, .sparcv9 => true, else => false, }; } |
