Skip to content

Commit 8209cfe

Browse files
committed
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: ziglang#8301 (comment)
1 parent a4a9f1e commit 8209cfe

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/std/os/linux.zig

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,14 +2218,7 @@ pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize {
22182218
// call it fadvise64 (x86, PowerPC, etc), while newer ports call it fadvise64_64 (RISC-V,
22192219
// LoongArch, etc). SPARC is the odd one out because it has both.
22202220
return syscall4(
2221-
// 64-bit SPARC (apparently?) has a broken fadvise64_64, so use its fadvise64 instead.
2222-
// TODO: I can't make sense of this. They go to the same code in the kernel, and there
2223-
// is no special-casing for SPARC in glibc and musl. I suspect a QEMU bug, which is
2224-
// really not our responsibility.
2225-
if (@hasField(SYS, "fadvise64_64") and native_arch != .sparc64)
2226-
.fadvise64_64
2227-
else
2228-
.fadvise64,
2221+
if (@hasField(SYS, "fadvise64_64")) .fadvise64_64 else .fadvise64,
22292222
@as(usize, @bitCast(@as(isize, fd))),
22302223
@as(usize, @bitCast(offset)),
22312224
@as(usize, @bitCast(len)),

0 commit comments

Comments
 (0)