Skip to content

std: fix positioned read/write on VxWorks - #166395

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
joboet:vxworks_pio
Nov 24, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
joboet:vxworks_pio

Conversation

@joboet

@joboet joboet commented Nov 23, 2026

Copy link
Copy Markdown
Member

#160031 fixed an import error on VxWorks by shimming pread/pwrite. The added shims unconditionally returned -1, indicating an error, but failed to set errno to something like ENOSYS. This is problematic because it means the indicated error condition will be the value of whatever errno was last set to. A function like write_all_at that retries on EINTR might therefore loop indefinitely.

This PR removes the shims and instead returns an UNSUPPORTED_PLATFORM error – I think that makes it clearer that VxWorks does not define these functions at all.

CC @Darksonn @JohnTitor

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 23, 2026
@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 38 candidates
  • Random selection from JohnTitor, Mark-Simulacrum

@workingjubilee

Copy link
Copy Markdown
Member

Sure.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0cf9f9e has been approved by workingjubilee

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 24, 2026
Rollup of 11 pull requests

Successful merges:

 - #165769 (Fix invalid instantiation of fake intrinsic bodies)
 - #166374 (Undo accidental duplication checking for attributes on macro calls)
 - #166386 (Replace manual `AttributeParser` construction by `parse_limited_all`)
 - #162565 (Add `c_buffer_length` lint helper)
 - #166096 (llvm-wrapper: Pass more arguments to PreCodeGenCallback)
 - #166395 (std: fix positioned read/write on VxWorks)
 - #166404 (Change `ChildExt::kill_process_group` to be `&self`)
 - #166405 (Check for errors before encoding metadata)
 - #166412 (std: Fix locking test on GNU/Hurd)
 - #166413 (std: Fix symlink chmod test on GNU/Hurd)
 - #166421 (core: Stabilize `float_bits_const`)
@rust-bors
rust-bors Bot merged commit 0d3f87b into rust-lang:main Nov 24, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 24, 2026
Rollup merge of #166395 - joboet:vxworks_pio, r=workingjubilee

std: fix positioned read/write on VxWorks

#160031 fixed an import error on VxWorks by shimming `pread`/`pwrite`. The added shims unconditionally returned -1, indicating an error, but failed to set `errno` to something like `ENOSYS`. This is problematic because it means the indicated error condition will be the value of whatever `errno` was last set to. A function like `write_all_at` that retries on `EINTR` might therefore loop indefinitely.

This PR removes the shims and instead returns an `UNSUPPORTED_PLATFORM` error – I think that makes it clearer that VxWorks does not define these functions at all.

CC @Darksonn @JohnTitor
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Nov 26, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165769 (Fix invalid instantiation of fake intrinsic bodies)
 - rust-lang/rust#166374 (Undo accidental duplication checking for attributes on macro calls)
 - rust-lang/rust#166386 (Replace manual `AttributeParser` construction by `parse_limited_all`)
 - rust-lang/rust#162565 (Add `c_buffer_length` lint helper)
 - rust-lang/rust#166096 (llvm-wrapper: Pass more arguments to PreCodeGenCallback)
 - rust-lang/rust#166395 (std: fix positioned read/write on VxWorks)
 - rust-lang/rust#166404 (Change `ChildExt::kill_process_group` to be `&self`)
 - rust-lang/rust#166405 (Check for errors before encoding metadata)
 - rust-lang/rust#166412 (std: Fix locking test on GNU/Hurd)
 - rust-lang/rust#166413 (std: Fix symlink chmod test on GNU/Hurd)
 - rust-lang/rust#166421 (core: Stabilize `float_bits_const`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants