authorgravatar for pat.github@tullmann.orgPat Tullmann <pat.github@tullmann.org> 2025-04-24 22:02:53-07:00
committergravatar for pat.github@tullmann.orgPat Tullmann <pat.github@tullmann.org> 2025-04-30 20:32:04-07:00
logcf989374e986462fef70fe4c1d0f5869b194148d
treec340f0cfef7b7431c4df326b93493270099dd4f5
parent120c4789c31c066f15fe414a5b32cdc7e80a065c

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.

8 files changed, 8 insertions(+), 9 deletions(-)

lib/std/os/linux/aarch64.zig+1-1
......@@ -289,7 +289,7 @@ pub const ucontext_t = extern struct {
289289 flags: usize,
290290 link: ?*ucontext_t,
291291 stack: stack_t,
292 sigmask: sigset_t,
292 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
293293 mcontext: mcontext_t,
294294};
295295
lib/std/os/linux/arm.zig+1-1
......@@ -337,7 +337,7 @@ pub const ucontext_t = extern struct {
337337 link: ?*ucontext_t,
338338 stack: stack_t,
339339 mcontext: mcontext_t,
340 sigmask: sigset_t,
340 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
341341 regspace: [64]u64,
342342};
343343
lib/std/os/linux/loongarch64.zig+1-2
......@@ -264,8 +264,7 @@ pub const ucontext_t = extern struct {
264264 flags: c_ulong,
265265 link: ?*ucontext_t,
266266 stack: stack_t,
267 sigmask: sigset_t,
268 _pad: [1024 / 8 - @sizeOf(sigset_t)]u8,
267 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
269268 mcontext: mcontext_t,
270269};
271270
lib/std/os/linux/powerpc.zig+1-1
......@@ -341,7 +341,7 @@ pub const ucontext_t = extern struct {
341341 stack: stack_t,
342342 pad: [7]i32,
343343 regs: *mcontext_t,
344 sigmask: sigset_t,
344 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
345345 pad2: [3]i32,
346346 mcontext: mcontext_t,
347347};
lib/std/os/linux/powerpc64.zig+1-1
......@@ -337,7 +337,7 @@ pub const ucontext_t = extern struct {
337337 flags: u32,
338338 link: ?*ucontext_t,
339339 stack: stack_t,
340 sigmask: sigset_t,
340 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
341341 mcontext: mcontext_t,
342342};
343343
lib/std/os/linux/s390x.zig+1-1
......@@ -273,7 +273,7 @@ pub const ucontext_t = extern struct {
273273 link: ?*ucontext_t,
274274 stack: stack_t,
275275 mcontext: mcontext_t,
276 sigmask: sigset_t,
276 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
277277};
278278
279279pub const mcontext_t = extern struct {
lib/std/os/linux/sparc64.zig+1-1
......@@ -454,7 +454,7 @@ pub const ucontext_t = extern struct {
454454 sigmask: u64,
455455 mcontext: mcontext_t,
456456 stack: stack_t,
457 sigset: sigset_t,
457 sigset: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
458458};
459459
460460/// TODO
lib/std/os/linux/x86.zig+1-1
......@@ -350,7 +350,7 @@ pub const ucontext_t = extern struct {
350350 link: ?*ucontext_t,
351351 stack: stack_t,
352352 mcontext: mcontext_t,
353 sigmask: sigset_t,
353 sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask
354354 regspace: [64]u64,
355355};
356356