Skip to content

Commit 3b81a36

Browse files
committed
increase documentation of statfs/statvfs to prevent confusion
1 parent 14a5dcb commit 3b81a36

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/sys/statfs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ impl Debug for Statfs {
662662

663663
/// Describes a mounted file system.
664664
///
665-
/// The result is OS-dependent. For a portable alternative, see
665+
/// The result is OS-dependent. For a platform portable alternative, see
666666
/// [`statvfs`](crate::sys::statvfs::statvfs).
667667
///
668668
/// # Arguments
@@ -680,7 +680,7 @@ pub fn statfs<P: ?Sized + NixPath>(path: &P) -> Result<Statfs> {
680680

681681
/// Describes a mounted file system.
682682
///
683-
/// The result is OS-dependent. For a portable alternative, see
683+
/// The result is OS-dependent. For a platform portable alternative, see
684684
/// [`fstatvfs`](crate::sys::statvfs::fstatvfs).
685685
///
686686
/// # Arguments

src/sys/statvfs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ libc_bitflags!(
5555

5656
/// Wrapper around the POSIX `statvfs` struct
5757
///
58+
/// Note that the types provided by this struct are based off of libc definitions, and as such do
59+
/// not always resolve to the same concrete number type on different platforms. Using techniques
60+
/// such as `u64::from` may be desirable when implementing "Rust portable" math.
61+
///
5862
/// For more information see the [`statvfs(3)` man pages](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html).
5963
#[repr(transparent)]
6064
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]

0 commit comments

Comments
 (0)