Skip to content

glibc: add __f_unused to statvfs64 on riscv32 - #5518

Open
Yasser-Ameur wants to merge 1 commit into
rust-lang:mainfrom
Yasser-Ameur:fix/statvfs64-f-unused-riscv32
Open

glibc: add __f_unused to statvfs64 on riscv32#5518
Yasser-Ameur wants to merge 1 commit into
rust-lang:mainfrom
Yasser-Ameur:fix/statvfs64-f-unused-riscv32

Conversation

@Yasser-Ameur

@Yasser-Ameur Yasser-Ameur commented Sep 8, 2026

Copy link
Copy Markdown

statvfs64 is missing __f_unused on riscv32, so every field after f_fsid
sits four bytes off.

glibc gates both structs on the same macro and riscv32 satisfies it: __WORDSIZE
is 32 there and nothing defines __SYSCALL_WORDSIZE. statvfs already carries
the field. This was the FIXME left in #5434.

There is no riscv32 ctest job, so I checked with a probe instead:
offset_of!(statvfs64, f_flag) moves 60 to 64 on riscv32 and stays 72 on
x86_64.

Closes #5512

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a rather long description for a simple change. Please handwrite all communication with users, including PR descriptions and commit messages.

View changes since this review

@rustbot

rustbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Yasser-Ameur
Yasser-Ameur marked this pull request as ready for review September 8, 2026 23:48
glibc gates `statvfs` and `statvfs64` on the same macro, and riscv32 satisfies
it: `__WORDSIZE` is 32 there and nothing defines `__SYSCALL_WORDSIZE`. Only
`statvfs` carried the field, so every `statvfs64` field after `f_fsid` sat four
bytes off. This was the FIXME left in rust-lang#5434.

https://github.com/sailfishos-mirror/glibc/blob/92861d93cdad13834f4d8f39504b550a80ad8200/sysdeps/unix/sysv/linux/bits/statvfs.h#L24-L27
@Yasser-Ameur
Yasser-Ameur force-pushed the fix/statvfs64-f-unused-riscv32 branch from 30b0295 to ff2c5ec Compare September 9, 2026 00:06
@rustbot

rustbot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • There are uncanonicalized issue links (such as #123) in the commit messages of the following commits.
    Please add the organization and repository before the issue number (like so rust-lang/rust#123) to avoid issues with subtree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glibc: statvfs64 is missing __f_unused on riscv32-gnu

3 participants