authorgravatar for pat.github@tullmann.orgPat Tullmann <pat.github@tullmann.org> 2025-04-28 22:29:26-07:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-05-02 18:30:50+02:00
log142a890c37c0217dbeb837bcc6dc28266c2129ba
treeb5c99f18ab9dbf42a1a7e9104ec2fb3302f8439e
parent331bd83f1115bf5e33b6b2d7651d67dcfe16ac2a
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux: Fix MIPS signal numbers

Dunno why the MIPS signal numbers are different, or why Zig had them already special cased, but wrong. We have the technology to test these constants. We should use it.

1 files changed, 21 insertions(+), 21 deletions(-)

lib/std/os/linux.zig+21-21
...@@ -3385,6 +3385,7 @@ pub const SIG = if (is_mips) struct {...@@ -3385,6 +3385,7 @@ pub const SIG = if (is_mips) struct {
3385 pub const UNBLOCK = 2;3385 pub const UNBLOCK = 2;
3386 pub const SETMASK = 3;3386 pub const SETMASK = 3;
33873387
3388 // https://github.com/torvalds/linux/blob/ca91b9500108d4cf083a635c2e11c884d5dd20ea/arch/mips/include/uapi/asm/signal.h#L25
3388 pub const HUP = 1;3389 pub const HUP = 1;
3389 pub const INT = 2;3390 pub const INT = 2;
3390 pub const QUIT = 3;3391 pub const QUIT = 3;
...@@ -3392,33 +3393,32 @@ pub const SIG = if (is_mips) struct {...@@ -3392,33 +3393,32 @@ pub const SIG = if (is_mips) struct {
3392 pub const TRAP = 5;3393 pub const TRAP = 5;
3393 pub const ABRT = 6;3394 pub const ABRT = 6;
3394 pub const IOT = ABRT;3395 pub const IOT = ABRT;
3395 pub const BUS = 7;3396 pub const EMT = 7;
3396 pub const FPE = 8;3397 pub const FPE = 8;
3397 pub const KILL = 9;3398 pub const KILL = 9;
3398 pub const USR1 = 10;3399 pub const BUS = 10;
3399 pub const SEGV = 11;3400 pub const SEGV = 11;
3400 pub const USR2 = 12;3401 pub const SYS = 12;
3401 pub const PIPE = 13;3402 pub const PIPE = 13;
3402 pub const ALRM = 14;3403 pub const ALRM = 14;
3403 pub const TERM = 15;3404 pub const TERM = 15;
3404 pub const STKFLT = 16;3405 pub const USR1 = 16;
3405 pub const CHLD = 17;3406 pub const USR2 = 17;
3406 pub const CONT = 18;3407 pub const CHLD = 18;
3407 pub const STOP = 19;3408 pub const PWR = 19;
3408 pub const TSTP = 20;3409 pub const WINCH = 20;
3409 pub const TTIN = 21;3410 pub const URG = 21;
3410 pub const TTOU = 22;3411 pub const IO = 22;
3411 pub const URG = 23;3412 pub const POLL = IO;
3412 pub const XCPU = 24;3413 pub const STOP = 23;
3413 pub const XFSZ = 25;3414 pub const TSTP = 24;
3414 pub const VTALRM = 26;3415 pub const CONT = 25;
3415 pub const PROF = 27;3416 pub const TTIN = 26;
3416 pub const WINCH = 28;3417 pub const TTOU = 27;
3417 pub const IO = 29;3418 pub const VTALRM = 28;
3418 pub const POLL = 29;3419 pub const PROF = 29;
3419 pub const PWR = 30;3420 pub const XCPU = 30;
3420 pub const SYS = 31;3421 pub const XFZ = 31;
3421 pub const UNUSED = SIG.SYS;
34223422
3423 pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));3423 pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
3424 pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);3424 pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);