musl: Move statfs.h and statvfs.h definitions to src/new - #5529
Open
valentynkit wants to merge 2 commits into
Open
valentynkit wants to merge 2 commits into
valentynkit wants to merge 2 commits into
Conversation
This follows the ongoing migration into `src/new`, which reduces duplication and models musl's source tree. Arch specific definitions are kept for `mips`, `mips64` and `s390x`, mirroring musl's `arch/*/bits/statfs.h`. `statfs64` is now a type alias for `statfs`, as it already was on `s390x`. musl has no second struct: `sys/statfs.h` `#define`s `statfs64` to `statfs`, and the lfs types `fsblkcnt64_t` and `fsfilcnt64_t` to `fsblkcnt_t` and `fsfilcnt_t`. This crate declares both spellings as `c_ulonglong` on every musl target, so the duplicated structs had identical layout. Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/include/sys/statfs.h Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/arch/s390x/bits/statfs.h Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/arch/mips/bits/statfs.h Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/arch/mips64/bits/statfs.h
This follows the ongoing migration into `src/new`, which reduces duplication and models musl's source tree. `statvfs64` is now a type alias for `statvfs`. As with `statfs`, musl has no second struct: `sys/statvfs.h` `#define`s `statvfs64` to `statvfs`, and the lfs types `fsblkcnt64_t` and `fsfilcnt64_t` to `fsblkcnt_t` and `fsfilcnt_t`. This crate declares both spellings as `c_ulonglong` on every musl target, so the duplicated structs had identical layout. Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/include/sys/statvfs.h
Contributor
Author
|
These changes follow from previous work in this repo, the ongoing migration to src/new suggests contributions like this are useful, but let me know if this isn't wanted Two things worth attention:
|
valentynkit
marked this pull request as ready for review
September 15, 2026 19:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows the ongoing migration into
src/new, which reducesduplication and models musl's source tree.
Arch specific definitions are kept for
mips,mips64ands390x,mirroring musl's
arch/*/bits/statfs.h.statfs64is now a type alias forstatfs, as it already was ons390x. musl has no second struct:sys/statfs.h#definesstatfs64tostatfs, and the lfs typesfsblkcnt64_tandfsfilcnt64_ttofsblkcnt_tandfsfilcnt_t. This crate declaresboth spellings as
c_ulonglongon every musl target, so the duplicatedstructs had identical layout.
statvfs64is now also a type alias forstatvfsfollowing the same reasons as before.Let me know if I should revert the changes for using type alias, and just do the migration without it, but from my findings it looks safe to do.
https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/include/sys/statfs.h#L21-L26
libc/src/unix/linux_like/linux/musl/mod.rs
Lines 39 to 46 in b99bf9d
Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/include/sys/statfs.h
Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/include/sys/statvfs.h
Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/arch/s390x/bits/statfs.h
Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/arch/mips/bits/statfs.h
Link: https://github.com/kraj/musl/blob/1c82569f4cc53f5bb25c820051c2a02463f46cab/arch/mips64/bits/statfs.h