Pat Tullmann 4b63f94b4e Fix sigaddset/sigdelset bit-fiddling math
The code was using u32 and usize interchangably, which doesn't work on
64-bit systems.  This:
  `pub const sigset_t = [1024 / 32]u32;`
is not consistent with this:
  `const shift = @as(u5, @intCast(s & (usize_bits - 1)));`

However, normal signal numbers are less than 31, so the bad math doesn't matter much.  Also, despite support for 1024 signals in the set, only setting signals between 1 and NSIG (which is mostly 65, but sometimes 128) is defined.  The existing tests only exercised signal numbers in the first 31 bits so they didn't trip over this:

The C library `sigaddset` will return `EINVAL` if given an out of bounds signal number.  I made the Zig code just silently ignore any out of bounds signal numbers.

Moved all the `sigset` related declarations next to each in the source, too.

The `filled_sigset` seems non-standard to me.  I think it is meant to be used like `empty_sigset`, but it only contains 31 set signals, which seems wrong (should be 64 or 128, aka `NSIG`).  It's also unused.  The oddly named but similar `all_mask` is used (by posix.zig) but sets all 1024 bits (which I understood to be undefined behavior but seems to work just fine).  For comparison the musl `sigfillset` fills in 65 bits or 128 bits.
2025-04-10 23:49:44 +02:00
..
2024-12-19 17:10:03 -05:00
2025-02-22 14:32:48 -08:00
2025-04-03 14:55:04 -07:00
2025-04-05 21:20:10 +02:00
2025-04-03 14:55:04 -07:00
2025-02-05 13:58:15 +01:00
2024-08-22 08:44:08 +02:00
2025-02-06 14:23:23 -08:00
2025-03-17 21:56:17 +03:30
2025-02-22 14:32:48 -08:00
2024-08-07 00:48:32 -07:00
2024-08-29 23:43:52 +01:00
2025-01-16 20:42:08 -05:00
2025-04-03 15:35:21 -07:00
2025-02-06 14:23:23 -08:00
2025-02-03 09:14:37 +00:00