increase documentation of statfs/statvfs to prevent confusion#2700
increase documentation of statfs/statvfs to prevent confusion#2700ultrabear wants to merge 1 commit intonix-rust:masterfrom
Conversation
There was a problem hiding this comment.
I accept the changes in statfs.rs, but I don't think the changes in this file are necessary.
What I am more interested in is refactoring the function signatures to use integer types with specified width:
fn block_size(&self) -> u64Looks like using u64 should just work as rustix uses u64 for all the Statvfs fields, but we may still want to check the concrete integer type used by those libc alias, just in case
There was a problem hiding this comment.
if it was always u64, wouldn't have had a build failure
on darwin the block_size resolves to u32
Indeed, this can be trivially widened to u64, but that abstracts from the libc struct, so depends on what the goal of the library is (not in my domain of understanding)
There was a problem hiding this comment.
Indeed, this can be trivially widened to u64
Yeah, that's what I meant
Regarding this PR, do you want to merge the changes in statfs.rs? I think they are good
There was a problem hiding this comment.
Sorry for the long delay, updating the PR to just be the statfs.rs changes
revert statvfs
3b81a36 to
d9a5c92
Compare
This closes #2699 by increasing the amount of documentation on fstatfs and fstatvfs to reduce confusion when writing code against these apis.
Probably could be tweaked, might be too niche or specific for top level documentation, but it would have prevented a lost day of development in practice so I thought it would be worthwhile to send a PR in regardless.
Checklist:
CONTRIBUTING.md