Skip to content

Commit 3258cd3

Browse files
authored
Enable statvfs for Haiku. (#1515)
A previous commit enabled fstatvfs, but missed statvfs, which exists on Haiku as well.
1 parent 3e853c8 commit 3258cd3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/fs/abs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::fs::Access;
1515
target_os = "wasi",
1616
)))]
1717
use crate::fs::StatFs;
18-
#[cfg(not(any(target_os = "haiku", target_os = "wasi")))]
18+
#[cfg(not(any(target_os = "wasi")))]
1919
use crate::fs::StatVfs;
2020
use crate::fs::{Mode, OFlags, Stat};
2121
#[cfg(not(target_os = "wasi"))]
@@ -283,7 +283,7 @@ pub fn statfs<P: path::Arg>(path: P) -> io::Result<StatFs> {
283283
///
284284
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/statvfs.html
285285
/// [Linux]: https://man7.org/linux/man-pages/man2/statvfs.2.html
286-
#[cfg(not(any(target_os = "haiku", target_os = "wasi")))]
286+
#[cfg(not(any(target_os = "wasi")))]
287287
#[inline]
288288
pub fn statvfs<P: path::Arg>(path: P) -> io::Result<StatVfs> {
289289
path.into_with_c_str(backend::fs::syscalls::statvfs)

tests/fs/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ fn test_file() {
152152
assert!(statfs.f_blocks > 0);
153153
}
154154

155-
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
155+
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
156156
{
157157
let statvfs = rustix::fs::fstatvfs(&file).unwrap();
158158
assert!(statvfs.f_frsize > 0);

0 commit comments

Comments
 (0)