authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-06-23 19:23:17+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-29 09:50:41+02:00
log43410cdfe91548408083327e428404b192ced524
treeb1575ed797fd6ab82ecc766cd8b893d2c4f88d5f
parent890433e292da449e79c5a8c2efb91f65555da775
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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

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

lib/std/os/linux.zig+1-8
......@@ -2272,14 +2272,7 @@ pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize {
22722272 // call it fadvise64 (x86, PowerPC, etc), while newer ports call it fadvise64_64 (RISC-V,
22732273 // LoongArch, etc). SPARC is the odd one out because it has both.
22742274 return syscall4(
2275 // 64-bit SPARC (apparently?) has a broken fadvise64_64, so use its fadvise64 instead.
2276 // TODO: I can't make sense of this. They go to the same code in the kernel, and there
2277 // is no special-casing for SPARC in glibc and musl. I suspect a QEMU bug, which is
2278 // really not our responsibility.
2279 if (@hasField(SYS, "fadvise64_64") and native_arch != .sparc64)
2280 .fadvise64_64
2281 else
2282 .fadvise64,
2275 if (@hasField(SYS, "fadvise64_64")) .fadvise64_64 else .fadvise64,
22832276 @as(usize, @bitCast(@as(isize, fd))),
22842277 @as(usize, @bitCast(offset)),
22852278 @as(usize, @bitCast(len)),