std: Update more siginfo bits for BSDs

This commit is contained in:
LemonBoy 2020-12-13 19:28:38 +01:00
parent fc70db5ab5
commit 3375a580be
2 changed files with 16 additions and 6 deletions

View File

@ -805,6 +805,10 @@ pub const sigset_t = extern struct {
__bits: [_SIG_WORDS]u32,
};
pub const SIG_ERR = @intToPtr(?Sigaction.sigaction_fn, maxInt(usize));
pub const SIG_DFL = @intToPtr(?Sigaction.sigaction_fn, 0);
pub const SIG_IGN = @intToPtr(?Sigaction.sigaction_fn, 1);
pub const empty_sigset = sigset_t{ .__bits = [_]u32{0} ** _SIG_WORDS };
// XXX x86_64 specific

View File

@ -773,11 +773,6 @@ pub const sigval = extern union {
};
pub const siginfo_t = extern union {
pad: [128]u8,
info: _ksiginfo,
};
pub const _ksiginfo = extern struct {
signo: c_int,
code: c_int,
errno: c_int,
@ -794,11 +789,22 @@ pub const _ksiginfo = extern struct {
addr: ?*c_void,
trapno: c_int,
},
__pad: [128 - 3 * @sizeOf(c_int)]u8,
} align(@sizeOf(usize)),
};
comptime {
std.debug.assert(@sizeOf(siginfo_t) == 128);
}
pub const sigset_t = c_uint;
pub const empty_sigset = sigset_t(0);
pub const empty_sigset: sigset_t = 0;
pub const SIG_ERR = @intToPtr(?Sigaction.sigaction_fn, maxInt(usize));
pub const SIG_DFL = @intToPtr(?Sigaction.sigaction_fn, 0);
pub const SIG_IGN = @intToPtr(?Sigaction.sigaction_fn, 1);
pub const SIG_CATCH = @intToPtr(?Sigaction.sigaction_fn, 2);
pub const SIG_HOLD = @intToPtr(?Sigaction.sigaction_fn, 3);
pub const EPERM = 1; // Operation not permitted
pub const ENOENT = 2; // No such file or directory