Skip to content
/ zig Public
forked from ziglang/zig

Commit 78cfdd1

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 e69631a commit 78cfdd1

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

0 commit comments

Comments
 (0)