authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-17 07:16:33+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-17 16:28:14+02:00
log002ee8e6d38024b9a7db90347c3fb9189edd1bc8
treebe5bfe271c96c81ca258c337597afd46d247df11
parent3f956f98903214a6a79a123d62c4084ea3ba49f9
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux: make errno() accept u64 instead of usize

lseek() on x32/n32 returns u64 despite usize == u32.

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

lib/std/os/linux.zig+2-2
...@@ -752,8 +752,8 @@ fn splitValue64(val: i64) [2]u32 {...@@ -752,8 +752,8 @@ fn splitValue64(val: i64) [2]u32 {
752}752}
753753
754/// Get the errno from a syscall return value. SUCCESS means no error.754/// Get the errno from a syscall return value. SUCCESS means no error.
755pub fn errno(r: usize) E {755pub fn errno(r: u64) E {
756 const signed_r: isize = @bitCast(r);756 const signed_r: i32 = @bitCast(@as(u32, @truncate(r)));
757 const int = if (signed_r > -4096 and signed_r < 0) -signed_r else 0;757 const int = if (signed_r > -4096 and signed_r < 0) -signed_r else 0;
758 return @enumFromInt(int);758 return @enumFromInt(int);
759}759}