glibc: Add f_type to statvfs and statvfs64 - #5434
Conversation
Almost every glibc 32-bit arch declared an identical `statvfs64`. Six of the eight were fully the same, so they move to the shared `b32/mod.rs`. `m68k` and `riscv32` differ, so they are excluded by cfg, and keep their own declarations. No functional change: shared declaration is byte-for-byte identical to the six it replaces.
No functional changes: shared declaration is byte for byte identical to architecture specifics it replaces, only `riscv64` differs, and guarded by cfg, to use it own declaration.
glibc 2.39 allocated one of the six spares to `f_type` of type unsigned int. Link: https://github.com/sailfishos-mirror/glibc/blob/ef321e23c20eebc6d6fb4044425c00e6df27b05f/sysdeps/unix/sysv/linux/bits/statvfs.h#L75-L76 Link: https://github.com/sailfishos-mirror/glibc/blob/ef321e23c20eebc6d6fb4044425c00e6df27b05f/sysdeps/unix/sysv/linux/bits/statvfs.h#L54-L55
|
Is it okay to have it as one PR, or should dedup in gnu/b32 and gnu/b64 be separate PR? |
|
Any chance you'd be willing to move Doing this in the same PR is fine as long as it's a separate commit, we use rebase merging. |
|
I missed a couple of things:
Mind doing musl in a followup?
It's fine to make it non- Few things here so |
|
Reminder, once the PR becomes ready for a review, use |
glibc 2.39 allocated one of the six reserved
__f_spareints tof_typeforstatvfsandstatvfs64, which mirrorsstatfs.sailfishos-mirror/glibc@92861d9
Adding
f_typetostatvfsandstatvfs64for linux/gnu, usingc_uint.Also deduplicated
statvfs64for 32-bit arch, it was declared byte-for-byte identical on six of the eight platforms, so it was moved to the sharedb32/mod.rs(m68kandriscv32differ, so they are excluded by cfg, and keep their own declaration). And deduplicatedstatvfsandstatvfs64for 64-bit arch, keeping onlyriscv64excluded by cfg, and keeping its own declaration.There is also musl that is missing
f_type. It wasn't addressed in this PR, should I address musl also, or any other not just glibc?Also
riscv32andriscv64declare their__f_sparefield as pub, it feels inconsistent with the other declarations, and forriscv64it is the reason it keeps its own declaration (riscv32differs in also lacking__f_unused). Is there a specific reason to have itpub __f_spare, or should this be addressed and fixed?Closes #4121
Checklist
libc-test/semverhave been updated, no change needed.cargo test -p libc-test --target mytarget); especially relevant for platforms that may not be checked in CI@rustbot label +stable-nominated