-
Notifications
You must be signed in to change notification settings - Fork 29
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
Return file creation times on Linux (using statx) #248
Merged
Commits on Jun 3, 2022
-
Return file creation times on Linux (using statx)
Rust's standard library returns file creation times on Linux (at least with glibc), and now rust-std will too. File creation times are available on Linux via the `statx` syscall (not `fstatat`), introduced in kernel 4.11, which was released in April 2017. The Rust standard library already uses `statx` on Linux with glibc. Making cap-std support file creation times on Linux required two changes: 1. `File::metadata()` uses the standard library (which uses `statx`), but this wouldn't ever copy over the created field on Linux. Now, any time the created field is set in the std Metadata struct, it's also set in the cap-primitives Metadata, regardless of platform. 2. `stat_unchecked` is used in several places, including fetching DirEntry metadata. Before, it called `fstatat` directly. Now, it calls `statx` on Linux when available, and it falls back to `fstatat` otherwise. Fortunately, Dan Gohman (@sunfishcode) had already added a method to convert `statx` results in commit d1fa735 (PR bytecodealliance#105) in 2020. This commit also adds a new test to make sure file creation times are set in cap-std Metadata if they are set in std Metadata.
Configuration menu - View commit details
-
Copy full SHA for 1307013 - Browse repository at this point
Copy the full SHA 1307013View commit details -
stat_unchecked: Add backticks to comments from PR suggestions
Co-authored-by: Dan Gohman <dev@sunfishcode.online>
Configuration menu - View commit details
-
Copy full SHA for 0b7dc95 - Browse repository at this point
Copy the full SHA 0b7dc95View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26270cd - Browse repository at this point
Copy the full SHA 26270cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for c7f65a2 - Browse repository at this point
Copy the full SHA c7f65a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6112c88 - Browse repository at this point
Copy the full SHA 6112c88View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29cd8dd - Browse repository at this point
Copy the full SHA 29cd8ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2eca023 - Browse repository at this point
Copy the full SHA 2eca023View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5aa6a77 - Browse repository at this point
Copy the full SHA 5aa6a77View commit details -
fs_additional: Fix non-Unix test build in metadata test
I had used `cfg!(unix)` instead of `#[cfg(unix)]` in 2eca023, which doesn't conditionally compile out the Unix-specific code.
Configuration menu - View commit details
-
Copy full SHA for 7cee463 - Browse repository at this point
Copy the full SHA 7cee463View commit details
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.