Skip to content

Commit 43410cd

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: #8301 (comment)
1 parent 890433e commit 43410cd

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
@@ -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)),

0 commit comments

Comments
 (0)