Skip to content

Commit 4d35ffa

Browse files
committed
use off64_t and *64() functions on uclibc, too
1 parent beb22da commit 4d35ffa

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mod macros;
6969
// type that allows larger offsets to be used. We define our own off_t type
7070
// that is large enough to represent all file offsets the platform supports.
7171
cfg_if! {
72-
if #[cfg(all(target_os = "linux", target_env = "gnu"))] {
72+
if #[cfg(any(all(target_os = "linux", target_env = "gnu"), target_env = "uclibc"))] {
7373
/// Used to represent offsets in files. May differ from libc::off_t
7474
/// on platforms where libc::off_t cannot represent the full range
7575
/// of file offsets.

src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ macro_rules! libc_enum {
333333
}
334334

335335
cfg_if! {
336-
if #[cfg(all(target_os = "linux", target_env = "gnu"))] {
336+
if #[cfg(any(all(target_os = "linux", target_env = "gnu"), target_env = "uclibc"))] {
337337
/// Function variant that supports large file positions.
338338
///
339339
/// On some platforms, the standard I/O functions support a limited

src/sys/uio.rs

-6
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ pub fn pwritev<Fd: AsFd, Off: Into<off_t>>(
5050
iov: &[IoSlice<'_>],
5151
offset: Off,
5252
) -> Result<usize> {
53-
#[cfg(target_env = "uclibc")]
54-
let offset = offset as libc::off64_t; // uclibc doesn't use off_t
55-
5653
// SAFETY: same as in writev()
5754
let res = unsafe {
5855
largefile_fn![pwritev](
@@ -80,9 +77,6 @@ pub fn preadv<Fd: AsFd, Off: Into<off_t>>(
8077
iov: &mut [IoSliceMut<'_>],
8178
offset: Off,
8279
) -> Result<usize> {
83-
#[cfg(target_env = "uclibc")]
84-
let offset = offset as libc::off64_t; // uclibc doesn't use off_t
85-
8680
// SAFETY: same as in readv()
8781
let res = unsafe {
8882
largefile_fn![preadv](

0 commit comments

Comments
 (0)