Description
When I upgraded to a recent toolchain (2021-03-25) and updated some crates to today's latest as a result, I started getting errors about missing libc::pwrite64()
for my uclibc-based target. I haven't tracked it all the way back to see when the error first started happening, but I think the issue is that the standard library source requires pwrite64()
for non-Android Linux:
https://github.com/rust-lang/rust/blob/48691ea6e639640f110b43e33d4aba1f07e7415c/library/std/src/sys/unix/fd.rs#L167-L183
#[cfg(target_os = "linux")]
use libc::pwrite64;
cvt(pwrite64(fd, buf, count, offset))
Whereas pwrite64()
is disallowed for uclibc in the libc
crate:
libc/src/unix/linux_like/mod.rs
Lines 1671 to 1685 in f913fc5
However, the companion function pread64()
is permitted for uclibc:
libc/src/unix/linux_like/mod.rs
Lines 1543 to 1548 in f913fc5
The actual pwrite64()
function is available on my uclibc target. Considering that libc
contains a SYS_pwrite64
value for uclibc targets, I suspect this is just an oversight in the libc
crate, and that pwrite64()
was not intended to be caveated by cfg(not(target_env = "uclibc"))
. Unless there is some other reason for disallowing pwrite64()
on uclibc-based Linux targets, could this function be promoted to work for uclibc variants?