From 386153612e4aab74b76c416eb96aa81dfca0c370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 17 Jun 2026 06:53:10 +0200 Subject: [PATCH] std.Io.Threaded: only use llseek() on Linux if @sizeOf(syscall_arg_t) == 4 The x32/n32 ABIs do not make this syscall available. closes https://codeberg.org/ziglang/zig/issues/35819 --- lib/std/Io/Threaded.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 48a0f798cd20d89eac4c928964e80d2ff65b1953..25286255522bef25297bc6158bf77e5abc83b747 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -10195,7 +10195,7 @@ fn fileSeekBy(userdata: ?*anyopaque, file: File, offset: i64) File.SeekError!voi if (posix.SEEK == void) return error.Unseekable; - if (native_os == .linux and !builtin.link_libc and @sizeOf(usize) == 4) { + if (native_os == .linux and !builtin.link_libc and @sizeOf(posix.system.syscall_arg_t) == 4) { var result: i64 = undefined; const syscall: Syscall = try .start(); while (true) { @@ -10307,7 +10307,7 @@ fn fileSeekTo(userdata: ?*anyopaque, file: File, offset: u64) File.SeekError!voi } fn posixSeekTo(fd: posix.fd_t, offset: u64) File.SeekError!void { - if (native_os == .linux and !builtin.link_libc and @sizeOf(usize) == 4) { + if (native_os == .linux and !builtin.link_libc and @sizeOf(posix.system.syscall_arg_t) == 4) { const syscall: Syscall = try .start(); while (true) { var result: i64 = undefined; -- 2.54.0