Skip to content

Add additional fields to statx #4621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Thomasdezeeuw
Copy link
Contributor

Description

Updates statx to include all fields as of Linux v6.16.

Sources

https://github.com/torvalds/linux/blob/038d61fd642278bab63ee8ef722c50d10ab01e8f/include/uapi/linux/stat.h#L99-L193

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

This is accurate for Linux v6.16.
@rustbot rustbot added 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 7, 2025
Android doesn't have them (yet).
@Thomasdezeeuw
Copy link
Contributor Author

The CI failure is a Clippy complaints about code I didn't change:

error: this `if` statement can be collapsed
   --> ctest-next/src/translator.rs:221:9
    |
221 | /         if let syn::PathArguments::AngleBracketed(args) = &last.arguments {
222 | |             if let syn::GenericArgument::Type(inner_ty) = args.args.first().unwrap() {
223 | |                 // Option<T> is ONLY ffi-safe if it contains a function pointer, or a reference.
224 | |                 match inner_ty {
...   |
237 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
    = note: `-D clippy::collapsible-if` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::collapsible_if)]`
help: collapse nested if block
    |
221 ~         if let syn::PathArguments::AngleBracketed(args) = &last.arguments
222 ~             && let syn::GenericArgument::Type(inner_ty) = args.args.first().unwrap() {
223 |                 // Option<T> is ONLY ffi-safe if it contains a function pointer, or a reference.
...
235 |                 }
236 ~             }
    |

error: could not compile `ctest-next` (lib) due to 1 previous error

If the maintainers want I can send a pr for this, but I don't think it should be done in this pr.

@tgross35
Copy link
Contributor

These haven't yet been updated in glibc https://github.com/bminor/glibc/blob/a6eb8285d9bfb7ec0875b85ca356e833ff964d4f/io/bits/types/struct_statx.h#L30 or musl, so we should wait for that.

@rustbot blocked

The CI failure is a Clippy complaints about code I didn't change:

That has been fixed, should go away with a rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-linux-like O-unix S-blocked 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.

3 participants