From d7176a3f334423619f778f2f4a197b1b64b2c59c Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Tue, 9 Sep 2025 19:28:56 +0200 Subject: [PATCH] Enable statvfs for Haiku. A previous commit enabled fstatvfs, but missed statvfs, which exists on Haiku as well. --- src/fs/abs.rs | 4 ++-- tests/fs/file.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fs/abs.rs b/src/fs/abs.rs index 307698b53..6642fee65 100644 --- a/src/fs/abs.rs +++ b/src/fs/abs.rs @@ -15,7 +15,7 @@ use crate::fs::Access; target_os = "wasi", )))] use crate::fs::StatFs; -#[cfg(not(any(target_os = "haiku", target_os = "wasi")))] +#[cfg(not(any(target_os = "wasi")))] use crate::fs::StatVfs; use crate::fs::{Mode, OFlags, Stat}; #[cfg(not(target_os = "wasi"))] @@ -283,7 +283,7 @@ pub fn statfs(path: P) -> io::Result { /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/statvfs.html /// [Linux]: https://man7.org/linux/man-pages/man2/statvfs.2.html -#[cfg(not(any(target_os = "haiku", target_os = "wasi")))] +#[cfg(not(any(target_os = "wasi")))] #[inline] pub fn statvfs(path: P) -> io::Result { path.into_with_c_str(backend::fs::syscalls::statvfs) diff --git a/tests/fs/file.rs b/tests/fs/file.rs index 0dc497fdf..cb7e0c7fe 100644 --- a/tests/fs/file.rs +++ b/tests/fs/file.rs @@ -152,7 +152,7 @@ fn test_file() { assert!(statfs.f_blocks > 0); } - #[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))] + #[cfg(not(any(target_os = "redox", target_os = "wasi")))] { let statvfs = rustix::fs::fstatvfs(&file).unwrap(); assert!(statvfs.f_frsize > 0);