Skip to content

Commit bcc098f

Browse files
committed
os/linux: workaround for sparcv9
1 parent 1338920 commit bcc098f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/std/os/linux.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,10 @@ pub fn fadvise(fd: fd_t, offset: u64, len: u64, advice: usize) usize {
14421442
length_halves[0],
14431443
length_halves[1],
14441444
);
1445-
} else if (@hasField(SYS, "fadvise64_64")) {
1445+
} else if (@hasField(SYS, "fadvise64_64") and usize_bits != 64) {
1446+
// The extra usize check is needed to avoid SPARC64 because it provides both
1447+
// fadvise64 and fadvise64_64 but the latter behaves differently than other platforms.
1448+
14461449
const offset_halves = splitValue64(@bitCast(u64, offset));
14471450
const length_halves = splitValue64(@bitCast(u64, len));
14481451

0 commit comments

Comments
 (0)