Skip to content

linux_like: add missing STATX_* constants - #5412

Open
valentynkit wants to merge 1 commit into
rust-lang:mainfrom
valentynkit:statx-constants
Open

linux_like: add missing STATX_* constants#5412
valentynkit wants to merge 1 commit into
rust-lang:mainfrom
valentynkit:statx-constants

Conversation

@valentynkit

@valentynkit valentynkit commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

libc already has struct statx fields through, which were added in #4621 but there are missing masks, so several fields are exposed with no way to request them.
Adding the five constants the header defines and libc does not.

The Android NDK doesn't have STATX_DIO_READ_ALIGN yet, so left out for Android. Three others landed in r28 and CI still runs r27, so they're skipped in test_android, without it, the fails will probably fail.

Earlier attempt adding these constants: #4401, closed unfinished.

Link: https://github.com/torvalds/linux/blob/8cd9520d35a6c38db6567e97dd93b1f11f185dc6/include/uapi/linux/stat.h#L218-L221
Link: https://github.com/torvalds/linux/blob/8cd9520d35a6c38db6567e97dd93b1f11f185dc6/include/uapi/linux/stat.h#L257
Link: https://android.googlesource.com/platform/bionic/+/a63b21091ada240d92f8ceadb1cabbdedaaab81b/libc/kernel/uapi/linux/stat.h#95
Link: https://man7.org/linux/man-pages/man2/statx.2.html

Description

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard
    doc comment
  • Tested locally (cargo test -p libc-test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

libc already has `struct statx` fields through 6.16 but there are
missing masks, so several fields are exposed with no way to request
them. Add the five constants the header defines and libc does not.

The NDK doesn't have `STATX_DIO_READ_ALIGN` yet, so left out for
Android. Three others landed in r28 and CI still runs r27, so they're
skipped in `test_android`.

Link: https://github.com/torvalds/linux/blob/8cd9520d35a6c38db6567e97dd93b1f11f185dc6/include/uapi/linux/stat.h#L218-L221
Link: https://github.com/torvalds/linux/blob/8cd9520d35a6c38db6567e97dd93b1f11f185dc6/include/uapi/linux/stat.h#L257
Link: https://android.googlesource.com/platform/bionic/+/a63b21091ada240d92f8ceadb1cabbdedaaab81b/libc/kernel/uapi/linux/stat.h#95
Link: https://man7.org/linux/man-pages/man2/statx.2.html
@rustbot rustbot added O-gnu O-linux O-linux-like O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-gnu O-linux O-linux-like O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants