Skip to content
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

Fix the fstat/statat/etc. fallback when statx fails with EPERM. #666

Merged
merged 1 commit into from
May 8, 2023

Conversation

sunfishcode
Copy link
Member

On some old non-y2038-safe container runtimes, statx fails with EPERM, so use crate::fs::statx instead of calling the statx syscall directly. This includes code to check whether it was a "real" EPERM we should return to the user, or an EPERM which indicates that statx isn't supported, allowing rustix to fall back to the old non-y2038-safe syscalls.

Also, update the crate-level comment mentionintg that rustix does sometimes do dynamic feature detection in order to support y2038 and LFS.

And fix a copy and paste in a comment in renameat2.

On some old non-y2038-safe container runtimes, `statx` fails with `EPERM`,
so use `crate::fs::statx` instead of calling the statx syscall directly.
This includes code to check whether it was a "real" `EPERM` we should
return to the user, or an `EPERM` which indicates that statx isn't
supported, allowing rustix to fall back to the old non-y2038-safe syscalls.

Also, update the crate-level comment mentionintg that rustix does
sometimes do dynamic feature detection in order to support y2038 and
LFS.

And fix a copy and paste in a comment in `renameat2`.
@sunfishcode sunfishcode merged commit eac93e7 into main May 8, 2023
@sunfishcode sunfishcode deleted the sunfishcode/statx branch May 17, 2023 14:23
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.

None yet

1 participant