-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Support File::seek
for Hermit
#138074
Support File::seek
for Hermit
#138074
Conversation
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
I have not setup Hermit for runtime testing, so although this compiles with To the Hermit maintainers: Please check that these invariants are also good for Hermit. rust/library/std/src/sys/pal/unix/fs.rs Lines 1428 to 1438 in 30f168e
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thanks a lot!
I have also tested this with Hermit and the kernel receives all system calls as expected. 👍
@mkroening Is the negative cast fine too? |
It looks like all Hermit targets are 64-bit, so the |
Do you mean casting In any case, since this appears to be fine to do on all Unixes, it should also be fine to do on Hermit, since we aim for POSIX compatibility for most file descriptor related things. |
☔ The latest upstream changes (presumably #138279) made this pull request unmergeable. Please resolve the merge conflicts. |
If a target maintainer is fine with it then I am too 🙂 @bors r+ |
…nton Support `File::seek` for Hermit `lseek` was added in `hermit-abi` in commit [87dd201](hermit-os/hermit-rs@87dd201) (add missing interface for lseek, 2024-07-15), which was just released in version 0.5.0. cc `@mkroening,` `@stlankes` Fixes hermit-os/hermit-rs#652
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…nton Support `File::seek` for Hermit `lseek` was added in `hermit-abi` in commit [87dd201](hermit-os/hermit-rs@87dd201) (add missing interface for lseek, 2024-07-15), which was just released in version 0.5.0. cc ```@mkroening,``` ```@stlankes``` Fixes hermit-os/hermit-rs#652
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138074 - thaliaarchi:hermit-seek, r=ChrisDenton Support `File::seek` for Hermit `lseek` was added in `hermit-abi` in commit [87dd201](hermit-os/hermit-rs@87dd201) (add missing interface for lseek, 2024-07-15), which was just released in version 0.5.0. cc ``@mkroening,`` ``@stlankes`` Fixes hermit-os/hermit-rs#652
…nton Support `File::seek` for Hermit `lseek` was added in `hermit-abi` in commit [87dd201](hermit-os/hermit-rs@87dd201) (add missing interface for lseek, 2024-07-15), which was just released in version 0.5.0. cc ``@mkroening,`` ``@stlankes`` Fixes hermit-os/hermit-rs#652
lseek
was added inhermit-abi
in commit 87dd201 (add missing interface for lseek, 2024-07-15), which was just released in version 0.5.0.cc @mkroening, @stlankes
Fixes hermit-os/hermit-rs#652