feat: support fallback to fstatat64 when statx is not available on Linux#361
Open
Lzzzzzt wants to merge 3 commits intobytedance:masterfrom
Open
feat: support fallback to fstatat64 when statx is not available on Linux#361Lzzzzzt wants to merge 3 commits intobytedance:masterfrom
Lzzzzzt wants to merge 3 commits intobytedance:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds fallback support for systems where the statx system call is not available on Linux by falling back to fstatat64. The implementation uses raw syscalls to avoid libc dependencies and includes optimizations to I/O operations and testing infrastructure.
- Implements fallback from
statxtofstatat64whenstatxreturnsENOSYSorENOTSUP - Uses raw syscalls instead of libc wrappers to avoid dependency issues
- Adds comprehensive test coverage for AsyncWriteRent and AsyncReadRent implementations
- Includes various code quality improvements and optimizations
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| monoio/src/driver/op/statx.rs | Core implementation of statx fallback logic with raw syscalls |
| monoio/src/fs/metadata/unix.rs | Adds From trait implementation for libc::stat64 |
| monoio/src/fs/metadata/mod.rs | Implements fallback logic in metadata functions |
| monoio/src/fs/file/unix.rs | Implements fallback logic for file metadata operations |
| monoio/src/io/async_write_rent.rs | Adds AsyncWriteRent implementations for Cursor and Box types |
| monoio/src/io/async_read_rent.rs | Improves AsyncReadRent implementation for mutable slices |
| monoio/tests/*.rs | Adds comprehensive test coverage for new functionality |
| monoio/src/utils/slab.rs | Performance optimization using is_multiple_of |
| Various other files | Code quality improvements and documentation updates |
Collaborator
Author
|
resolve #360 |
Collaborator
Author
|
also change the unmaintained crate |
Signed-off-by: Lzzzt <lzzzt.main@gmail.com>
Signed-off-by: Lzzzt <lzzzt.main@gmail.com>
8e38cf9 to
2c9fd8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR basically support fallback to fstat64 when statx is not available on Linux.
Change to do the raw syscall of
statx, which does not have requirements of libc, if this syscall failed withENOSYSthen fallback to thefstatat64