linux: update sigmask in every arch ucontext_t

All the existing code that manipulates `ucontext_t` expects there to be a
glibc-compatible sigmask (1024-bit).  The `ucontext_t` struct need to be
cleaned up so the glibc-dependent format is only used when linking
glibc/musl library, but that is a more involved change.

In practice, no Zig code looks at the sigset field contents, so it just
needs to be the right size.
This commit is contained in:
Pat Tullmann 2025-04-24 22:02:53 -07:00
parent 120c4789c3
commit cf989374e9
8 changed files with 8 additions and 9 deletions

View File

@ -289,7 +289,7 @@ pub const ucontext_t = extern struct {
flags: usize,
link: ?*ucontext_t,
stack: stack_t,
sigmask: sigset_t,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
mcontext: mcontext_t,
};

View File

@ -337,7 +337,7 @@ pub const ucontext_t = extern struct {
link: ?*ucontext_t,
stack: stack_t,
mcontext: mcontext_t,
sigmask: sigset_t,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
regspace: [64]u64,
};

View File

@ -264,8 +264,7 @@ pub const ucontext_t = extern struct {
flags: c_ulong,
link: ?*ucontext_t,
stack: stack_t,
sigmask: sigset_t,
_pad: [1024 / 8 - @sizeOf(sigset_t)]u8,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
mcontext: mcontext_t,
};

View File

@ -341,7 +341,7 @@ pub const ucontext_t = extern struct {
stack: stack_t,
pad: [7]i32,
regs: *mcontext_t,
sigmask: sigset_t,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
pad2: [3]i32,
mcontext: mcontext_t,
};

View File

@ -337,7 +337,7 @@ pub const ucontext_t = extern struct {
flags: u32,
link: ?*ucontext_t,
stack: stack_t,
sigmask: sigset_t,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
mcontext: mcontext_t,
};

View File

@ -273,7 +273,7 @@ pub const ucontext_t = extern struct {
link: ?*ucontext_t,
stack: stack_t,
mcontext: mcontext_t,
sigmask: sigset_t,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
};
pub const mcontext_t = extern struct {

View File

@ -454,7 +454,7 @@ pub const ucontext_t = extern struct {
sigmask: u64,
mcontext: mcontext_t,
stack: stack_t,
sigset: sigset_t,
sigset: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
};
/// TODO

View File

@ -350,7 +350,7 @@ pub const ucontext_t = extern struct {
link: ?*ucontext_t,
stack: stack_t,
mcontext: mcontext_t,
sigmask: sigset_t,
sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
regspace: [64]u64,
};