diff options
Diffstat (limited to '')
-rw-r--r-- | vendor/rustix/src/backend/libc/offset.rs (renamed from vendor/rustix/src/imp/libc/offset.rs) | 63 |
1 files changed, 54 insertions, 9 deletions
diff --git a/vendor/rustix/src/imp/libc/offset.rs b/vendor/rustix/src/backend/libc/offset.rs index 3002e8bdd..48729be0c 100644 --- a/vendor/rustix/src/imp/libc/offset.rs +++ b/vendor/rustix/src/backend/libc/offset.rs @@ -6,10 +6,11 @@ use super::c; #[cfg(not(any( windows, target_os = "android", - target_os = "linux", target_os = "emscripten", target_os = "l4re", + target_os = "linux", )))] +#[cfg(feature = "fs")] pub(super) use c::{ fstat as libc_fstat, fstatat as libc_fstatat, ftruncate as libc_ftruncate, lseek as libc_lseek, off_t as libc_off_t, @@ -17,33 +18,42 @@ pub(super) use c::{ #[cfg(any( target_os = "android", - target_os = "linux", target_os = "emscripten", target_os = "l4re", + target_os = "linux", ))] +#[cfg(feature = "fs")] pub(super) use c::{ fstat64 as libc_fstat, fstatat64 as libc_fstatat, ftruncate64 as libc_ftruncate, - lseek64 as libc_lseek, off64_t as libc_off_t, rlimit64 as libc_rlimit, + lseek64 as libc_lseek, off64_t as libc_off_t, }; +#[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "l4re", + target_os = "linux", +))] +pub(super) use c::rlimit64 as libc_rlimit; + #[cfg(not(any( windows, target_os = "android", - target_os = "linux", target_os = "emscripten", target_os = "l4re", + target_os = "linux", target_os = "wasi", )))] -#[cfg(any(feature = "mm", feature = "time", target_arch = "x86"))] // vdso.rs uses `madvise` +#[cfg(feature = "mm")] pub(super) use c::mmap as libc_mmap; #[cfg(not(any( windows, target_os = "android", - target_os = "linux", target_os = "emscripten", target_os = "fuchsia", target_os = "l4re", + target_os = "linux", target_os = "redox", target_os = "wasi", )))] @@ -83,7 +93,7 @@ pub(super) use c::{getrlimit64 as libc_getrlimit, setrlimit64 as libc_setrlimit} target_os = "emscripten", target_os = "l4re", ))] -#[cfg(any(feature = "mm", feature = "time", target_arch = "x86"))] // vdso.rs uses `madvise` +#[cfg(feature = "mm")] pub(super) use c::mmap64 as libc_mmap; // `prlimit64` wasn't supported in glibc until 2.13. @@ -150,6 +160,7 @@ pub(super) unsafe fn libc_prlimit( target_os = "l4re", target_os = "redox", )))] +#[cfg(feature = "fs")] pub(super) use c::openat as libc_openat; #[cfg(any( target_os = "android", @@ -157,17 +168,21 @@ pub(super) use c::openat as libc_openat; target_os = "emscripten", target_os = "l4re", ))] +#[cfg(feature = "fs")] pub(super) use c::openat64 as libc_openat; #[cfg(target_os = "fuchsia")] +#[cfg(feature = "fs")] pub(super) use c::fallocate as libc_fallocate; #[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "fs")] pub(super) use c::fallocate64 as libc_fallocate; #[cfg(not(any( windows, target_os = "android", target_os = "dragonfly", target_os = "emscripten", + target_os = "haiku", target_os = "illumos", target_os = "ios", target_os = "linux", @@ -176,7 +191,9 @@ pub(super) use c::fallocate64 as libc_fallocate; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] +#[cfg(feature = "fs")] pub(super) use c::posix_fadvise as libc_posix_fadvise; #[cfg(any( target_os = "android", @@ -184,6 +201,7 @@ pub(super) use c::posix_fadvise as libc_posix_fadvise; target_os = "linux", target_os = "l4re", ))] +#[cfg(feature = "fs")] pub(super) use c::posix_fadvise64 as libc_posix_fadvise; #[cfg(all(not(any( @@ -202,7 +220,7 @@ mod readwrite_pv64 { use super::c; // 64-bit offsets on 32-bit platforms are passed in endianness-specific - // lo/hi pairs. See src/imp/linux_raw/conv.rs for details. + // lo/hi pairs. See src/backend/linux_raw/conv.rs for details. #[cfg(all(target_endian = "little", target_pointer_width = "32"))] fn lo(x: u64) -> usize { (x >> 32) as usize @@ -288,10 +306,12 @@ mod readwrite_pv64 { windows, target_os = "android", target_os = "emscripten", + target_os = "haiku", target_os = "ios", target_os = "linux", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub(super) use c::{preadv as libc_preadv, pwritev as libc_pwritev}; #[cfg(target_os = "android")] @@ -324,6 +344,7 @@ pub(super) use readwrite_pv::{preadv as libc_preadv, pwritev as libc_pwritev}; #[cfg(not(any( windows, + target_os = "aix", target_os = "android", target_os = "dragonfly", target_os = "fuchsia", @@ -335,22 +356,42 @@ pub(super) use readwrite_pv::{preadv as libc_preadv, pwritev as libc_pwritev}; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] +#[cfg(feature = "fs")] pub(super) use c::posix_fallocate as libc_posix_fallocate; #[cfg(any(target_os = "l4re"))] +#[cfg(feature = "fs")] pub(super) use c::posix_fallocate64 as libc_posix_fallocate; #[cfg(not(any( windows, target_os = "android", target_os = "emscripten", + target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "l4re", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] +#[cfg(feature = "fs")] pub(super) use {c::fstatfs as libc_fstatfs, c::statfs as libc_statfs}; +#[cfg(not(any( + windows, + target_os = "android", + target_os = "emscripten", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "l4re", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] +#[cfg(feature = "fs")] +pub(super) use {c::fstatvfs as libc_fstatvfs, c::statvfs as libc_statvfs}; #[cfg(any( target_os = "android", @@ -358,4 +399,8 @@ pub(super) use {c::fstatfs as libc_fstatfs, c::statfs as libc_statfs}; target_os = "emscripten", target_os = "l4re", ))] -pub(super) use {c::fstatfs64 as libc_fstatfs, c::statfs64 as libc_statfs}; +#[cfg(feature = "fs")] +pub(super) use { + c::fstatfs64 as libc_fstatfs, c::fstatvfs64 as libc_fstatvfs, c::statfs64 as libc_statfs, + c::statvfs64 as libc_statvfs, +}; |