From 39ac38126546f2c8216e2ff9f84c1b3f888641cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 23 Jun 2024 19:23:17 +0200 Subject: [PATCH] std.os.linux: Remove the sparc64 workaround in fadvise(). This does not seem to be needed anymore, and it's unclear if it was ever truly needed or if it was just there to deal with a QEMU/strace bug. See: https://github.com/ziglang/zig/pull/8301#issuecomment-2184995749 --- lib/std/os/linux.zig | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index ca035cfd3a89..638eb086e117 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -2268,14 +2268,7 @@ pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize { // call it fadvise64 (x86, PowerPC, etc), while newer ports call it fadvise64_64 (RISC-V, // LoongArch, etc). SPARC is the odd one out because it has both. return syscall4( - // 64-bit SPARC (apparently?) has a broken fadvise64_64, so use its fadvise64 instead. - // TODO: I can't make sense of this. They go to the same code in the kernel, and there - // is no special-casing for SPARC in glibc and musl. I suspect a QEMU bug, which is - // really not our responsibility. - if (@hasField(SYS, "fadvise64_64") and native_arch != .sparc64) - .fadvise64_64 - else - .fadvise64, + if (@hasField(SYS, "fadvise64_64")) .fadvise64_64 else .fadvise64, @as(usize, @bitCast(@as(isize, fd))), @as(usize, @bitCast(offset)), @as(usize, @bitCast(len)),