Skip to content

Comments

feat: support fallback to fstatat64 when statx is not available on Linux#361

Open
Lzzzzzt wants to merge 3 commits intobytedance:masterfrom
Lzzzzzt:master
Open

feat: support fallback to fstatat64 when statx is not available on Linux#361
Lzzzzzt wants to merge 3 commits intobytedance:masterfrom
Lzzzzzt:master

Conversation

@Lzzzzzt
Copy link
Collaborator

@Lzzzzzt Lzzzzzt commented Aug 12, 2025

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 with ENOSYS then fallback to the fstatat64

@Lzzzzzt Lzzzzzt requested a review from Copilot August 12, 2025 08:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 statx to fstatat64 when statx returns ENOSYS or ENOTSUP
  • 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

@Lzzzzzt Lzzzzzt requested a review from ihciah August 12, 2025 10:52
@Lzzzzzt
Copy link
Collaborator Author

Lzzzzzt commented Aug 12, 2025

resolve #360

@Lzzzzzt
Copy link
Collaborator Author

Lzzzzzt commented Oct 13, 2025

also change the unmaintained crate fxhash to rustc-hash

@Lzzzzzt Lzzzzzt force-pushed the master branch 2 times, most recently from 8e38cf9 to 2c9fd8f Compare November 13, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant