Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/backend/libc/fs/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ use crate::fs::{fstat, Stat};
target_os = "wasi",
)))]
use crate::fs::{fstatfs, StatFs};
#[cfg(not(any(
solarish,
target_os = "haiku",
target_os = "redox",
target_os = "vita",
target_os = "wasi"
)))]
#[cfg(not(any(solarish, target_os = "redox", target_os = "vita", target_os = "wasi")))]
use crate::fs::{fstatvfs, StatVfs};
use crate::io;
#[cfg(not(any(target_os = "fuchsia", target_os = "vita", target_os = "wasi")))]
Expand Down Expand Up @@ -243,7 +237,6 @@ impl Dir {
/// `fstatvfs(self)`
#[cfg(not(any(
solarish,
target_os = "haiku",
target_os = "horizon",
target_os = "redox",
target_os = "vita",
Expand Down
8 changes: 4 additions & 4 deletions src/backend/libc/fs/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use crate::fs::Timestamps;
)))]
use crate::fs::{Dev, FileType};
use crate::fs::{Mode, OFlags, SeekFrom, Stat};
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
use crate::fs::{StatVfs, StatVfsMountFlags};
use crate::io;
#[cfg(all(target_env = "gnu", fix_y2038))]
Expand Down Expand Up @@ -271,7 +271,7 @@ pub(crate) fn statfs(filename: &CStr) -> io::Result<StatFs> {
}
}

#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[inline]
pub(crate) fn statvfs(filename: &CStr) -> io::Result<StatVfs> {
unsafe {
Expand Down Expand Up @@ -1591,7 +1591,7 @@ pub(crate) fn fstatfs(fd: BorrowedFd<'_>) -> io::Result<StatFs> {
}
}

#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
pub(crate) fn fstatvfs(fd: BorrowedFd<'_>) -> io::Result<StatVfs> {
let mut statvfs = MaybeUninit::<c::statvfs>::uninit();
unsafe {
Expand All @@ -1600,7 +1600,7 @@ pub(crate) fn fstatvfs(fd: BorrowedFd<'_>) -> io::Result<StatVfs> {
}
}

#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
fn libc_statvfs_to_statvfs(from: c::statvfs) -> StatVfs {
StatVfs {
f_bsize: from.f_bsize as u64,
Expand Down
8 changes: 4 additions & 4 deletions src/backend/libc/fs/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ bitflags! {
}
}

#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
bitflags! {
/// `ST_*` constants for use with [`StatVfs`].
#[repr(transparent)]
Expand Down Expand Up @@ -877,11 +877,11 @@ bitflags! {
const NOEXEC = c::ST_NOEXEC as u64;

/// `ST_NOSUID`
#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))]
#[cfg(not(any(target_os = "espidf", target_os = "haiku", target_os = "horizon", target_os = "vita")))]
const NOSUID = c::ST_NOSUID as u64;

/// `ST_RDONLY`
#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))]
#[cfg(not(any(target_os = "espidf", target_os = "haiku", target_os = "horizon", target_os = "vita")))]
const RDONLY = c::ST_RDONLY as u64;

/// `ST_RELATIME`
Expand Down Expand Up @@ -1077,7 +1077,7 @@ pub type Fsid = c::fsid_t;
///
/// [`statvfs`]: crate::fs::statvfs
/// [`fstatvfs`]: crate::fs::fstatvfs
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[allow(missing_docs)]
pub struct StatVfs {
pub f_bsize: u64,
Expand Down
4 changes: 2 additions & 2 deletions src/fs/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use backend::fs::types::Stat;
target_os = "wasi",
)))]
use backend::fs::types::StatFs;
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
use backend::fs::types::StatVfs;

/// Timestamps used by [`utimensat`] and [`futimens`].
Expand Down Expand Up @@ -196,7 +196,7 @@ pub fn fstatfs<Fd: AsFd>(fd: Fd) -> io::Result<StatFs> {
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fstatvfs.html
/// [Linux]: https://man7.org/linux/man-pages/man2/fstatvfs.2.html
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[inline]
pub fn fstatvfs<Fd: AsFd>(fd: Fd) -> io::Result<StatVfs> {
backend::fs::syscalls::fstatvfs(fd.as_fd())
Expand Down
2 changes: 1 addition & 1 deletion tests/io/ioctl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// `ioctl_fionread` on Windows doesn't work on files.
#[cfg(not(any(windows, target_os = "cygwin")))]
#[cfg(not(any(windows, target_os = "cygwin", target_os = "haiku")))]
#[test]
fn test_ioctls() {
let file = std::fs::File::open("Cargo.toml").unwrap();
Expand Down
Loading