| ... | ... | @@ -818,7 +818,12 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti |
| 818 | 818 | var ksa_old: k_sigaction = undefined; |
| 819 | 819 | const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask)); |
| 820 | 820 | @memcpy(@ptrCast([*]u8, &ksa.mask), @ptrCast([*]const u8, &act.mask), ksa_mask_size); |
| 821 | | const result = syscall4(.rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size); |
| 821 | const result = switch (builtin.arch) { |
| 822 | // The sparc version of rt_sigaction needs the restorer function to be passed as an argument too. |
| 823 | .sparc, .sparcv9 => syscall5(.rt_sigaction, sig, |
| 824 | @ptrToInt(&ksa), @ptrToInt(&ksa_old), @ptrToInt(ksa.restorer), ksa_mask_size), |
| 825 | else => syscall4(.rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size), |
| 826 | }; |
| 822 | 827 | const err = getErrno(result); |
| 823 | 828 | if (err != 0) { |
| 824 | 829 | return result; |