zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 386153612e4aab74b76c416eb96aa81dfca0c370 (tree)
parent 002ee8e6d38024b9a7db90347c3fb9189edd1bc8
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Wed, 17 Jun 2026 06:53:10 +0200

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

Diffstat:
Mlib/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 @@ -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;