From 3b81a36f59a5502b1027cdc1c4b7441407fd8377 Mon Sep 17 00:00:00 2001 From: ultrabear Date: Thu, 13 Nov 2025 10:54:27 -0800 Subject: [PATCH] increase documentation of statfs/statvfs to prevent confusion --- src/sys/statfs.rs | 4 ++-- src/sys/statvfs.rs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sys/statfs.rs b/src/sys/statfs.rs index c0a9f6c993..7893ff7fff 100644 --- a/src/sys/statfs.rs +++ b/src/sys/statfs.rs @@ -662,7 +662,7 @@ impl Debug for Statfs { /// Describes a mounted file system. /// -/// The result is OS-dependent. For a portable alternative, see +/// The result is OS-dependent. For a platform portable alternative, see /// [`statvfs`](crate::sys::statvfs::statvfs). /// /// # Arguments @@ -680,7 +680,7 @@ pub fn statfs(path: &P) -> Result { /// Describes a mounted file system. /// -/// The result is OS-dependent. For a portable alternative, see +/// The result is OS-dependent. For a platform portable alternative, see /// [`fstatvfs`](crate::sys::statvfs::fstatvfs). /// /// # Arguments diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs index db1abdd4fe..9c9e9b64c4 100644 --- a/src/sys/statvfs.rs +++ b/src/sys/statvfs.rs @@ -55,6 +55,10 @@ libc_bitflags!( /// Wrapper around the POSIX `statvfs` struct /// +/// Note that the types provided by this struct are based off of libc definitions, and as such do +/// not always resolve to the same concrete number type on different platforms. Using techniques +/// such as `u64::from` may be desirable when implementing "Rust portable" math. +/// /// For more information see the [`statvfs(3)` man pages](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html). #[repr(transparent)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]