zig/lib/std/os/linux
Alex Rønne Petersen d4973c9922 std.os.linux: Fix syscall errno value handling for mips.
The kernel sets r7 to 0 (success) or -1 (error), and stores the result in r2.
When r7 is -1 and the result is positive, it needs to be negated to get the
errno value that higher-level code, such as errnoFromSyscall(), expects to see.

The old code was missing the check that r2 is positive, but was also doing the
r7 check incorrectly; since it can only be set to 0 or -1, the blez instruction
would always branch.

In practice, this fix is necessary for e.g. the ENOSYS error to be interpreted
correctly. This manifested as hitting an unreachable branch when calling
process_vm_readv() in std.debug.MemoryAccessor.
2024-08-18 07:27:23 +02:00
..
bpf linux/bpf: update helper definitions 2023-11-19 19:01:18 +02:00
arm-eabi.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
arm64.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
bpf.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
io_uring_sqe.zig std.posix.iovec: use .base and .len instead of .iov_base and .iov_len 2024-04-28 00:20:30 -07:00
ioctl.zig std.Target: Remove sparcel architecture tag. 2024-07-30 06:30:25 +02:00
IoUring.zig add std.testing.random_seed 2024-07-23 11:43:12 -07:00
loongarch64.zig add getcontext 2024-08-13 10:11:17 -07:00
mips.zig std.os.linux: Fix syscall errno value handling for mips. 2024-08-18 07:27:23 +02:00
mips64.zig std.os.linux: Fix syscall errno value handling for mips. 2024-08-18 07:27:23 +02:00
powerpc.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
powerpc64.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
riscv32.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
riscv64.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
seccomp.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
sparc64.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
start_pie.zig std.os.linux.start_pie: Add support for the new RELR relocation format. 2024-08-11 20:27:09 -07:00
syscalls.zig Update Linux syscalls to 6.10. 2024-08-09 00:34:52 +02:00
test.zig Add getppid to std.c and std.os.linux. 2024-08-07 13:03:21 -07:00
thumb.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
tls.zig loongarch: fix asm to set thread pointer (#21086) 2024-08-15 15:40:44 -07:00
vdso.zig extract std.posix from std.os 2024-03-19 11:45:09 -07:00
x86.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00
x86_64.zig std.os.linux: Move clone() here and stop exporting it. 2024-08-07 01:19:51 -07:00