| ... | @@ -2272,14 +2272,7 @@ pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize { | ... | @@ -2272,14 +2272,7 @@ pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize { |
| 2272 | // call it fadvise64 (x86, PowerPC, etc), while newer ports call it fadvise64_64 (RISC-V, | 2272 | // call it fadvise64 (x86, PowerPC, etc), while newer ports call it fadvise64_64 (RISC-V, |
| 2273 | // LoongArch, etc). SPARC is the odd one out because it has both. | 2273 | // LoongArch, etc). SPARC is the odd one out because it has both. |
| 2274 | return syscall4( | 2274 | return syscall4( |
| 2275 | // 64-bit SPARC (apparently?) has a broken fadvise64_64, so use its fadvise64 instead. | 2275 | if (@hasField(SYS, "fadvise64_64")) .fadvise64_64 else .fadvise64, |
| 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, | | |
| 2283 | @as(usize, @bitCast(@as(isize, fd))), | 2276 | @as(usize, @bitCast(@as(isize, fd))), |
| 2284 | @as(usize, @bitCast(offset)), | 2277 | @as(usize, @bitCast(offset)), |
| 2285 | @as(usize, @bitCast(len)), | 2278 | @as(usize, @bitCast(len)), |