Skip to content

std: make positioned I/O unsupported on VxWorks - #160031

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
JohnTitor:vxworks-pread-pwrite-unsupported
Jul 31, 2026
Merged

std: make positioned I/O unsupported on VxWorks#160031
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
JohnTitor:vxworks-pread-pwrite-unsupported

Conversation

@JohnTitor

Copy link
Copy Markdown
Member

Currently, build-std for VxWorks fails because std calls pread/pwrite for positioned I/O.
Previously libc defined them as shims, but recently these were removed to align the actual state of SDK: rust-lang/libc#5129
It should make sense to return an unsupported error for VxWorks.
Fix rust-lang/libc#5328

@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

r? @Darksonn

rustbot has assigned @Darksonn.
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 13 candidates
  • Random selection from 6 candidates

@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 Jul 27, 2026
Comment thread library/std/src/sys/fd/unix.rs Outdated
Comment on lines 22 to 32

@Darksonn Darksonn Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, this is a bit messy. The current code has isolated all the conditional logic to this cfg_select!, but this PR introduces conditional logic in a bunch of other places.

If you do this, you can keep the conditional logic in one place:

Suggested change
cfg_select! {
target_os = "vxworks" => {
pub unsafe fn pread64(
_fd: c_int,
_buf: *mut c_void,
_count: size_t,
_offset: off64_t
) -> ssize_t {
-1
}
}
any(
all(target_os = "linux", not(target_env = "musl")),
target_os = "android",
target_os = "hurd",
) => {
// Prefer explicit pread64 for 64-bit offset independently of libc
// #[cfg(gnu_file_offset_bits64)].
use libc::pread64;
}

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Though it'd re-add shims, not returning the unsupported error. This PR's aim is to correct the behavior around it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Uhm, after re-thinking about it, aligning the behavior might be overkill here, including overriding errno. For now, added shims as you suggested.

@Darksonn Darksonn added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2026
@JohnTitor
JohnTitor force-pushed the vxworks-pread-pwrite-unsupported branch from 14b74b1 to 84af593 Compare July 30, 2026 11:44
@JohnTitor JohnTitor added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2026

@Darksonn Darksonn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 84af593 has been approved by Darksonn

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 Jul 30, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 30, 2026
…upported, r=Darksonn

std: make positioned I/O unsupported on VxWorks

Currently, build-std for VxWorks fails because std calls pread/pwrite for positioned I/O.
Previously libc defined them as shims, but recently these were removed to align the actual state of SDK: rust-lang/libc#5129
It should make sense to return an unsupported error for VxWorks.
Fix rust-lang/libc#5328
rust-bors Bot pushed a commit that referenced this pull request Jul 30, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #138230 (Add `raw_borrows_via_references` lint)
 - #160031 (std: make positioned I/O unsupported on VxWorks)
 - #159955 (Stop using higher-order macros to declare arenas)
 - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - #160177 (A few more "predicate"-to-"clause" renamings)
 - #160192 (Fix ICE for parsing issue with a closing brace)
 - #160209 (bootstrap: Remove method `Subcommand::kind`)
rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #160204 (Sync from portable simd 2026 07 30)
 - #138230 (Add `raw_borrows_via_references` lint)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one)
 - #160031 (std: make positioned I/O unsupported on VxWorks)
 - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - #160152 (Create on-demand CI job for testing EC2 instances)
 - #160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`)
 - #159214 (std: improve the documentation of the random feature)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #159955 (Stop using higher-order macros to declare arenas)
 - #159958 (Fix avoid cycle for self referential return type notation)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160144 (renovate: group lockfiles PRs)
 - #160149 (Fix Windows on Arm PAC default)
 - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160177 (A few more "predicate"-to-"clause" renamings)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
 - #160192 (Fix ICE for parsing issue with a closing brace)
 - #160209 (bootstrap: Remove method `Subcommand::kind`)
 - #160221 (Remove `Copy` supertrait from `VaList`)
 - #160223 (interpret: rename validate_operand → validate_place)
 - #160234 (Always use short ty path for call with missing arguments suggestion)
rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #160204 (Sync from portable simd 2026 07 30)
 - #138230 (Add `raw_borrows_via_references` lint)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one)
 - #160031 (std: make positioned I/O unsupported on VxWorks)
 - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - #160152 (Create on-demand CI job for testing EC2 instances)
 - #160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`)
 - #159214 (std: improve the documentation of the random feature)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #159955 (Stop using higher-order macros to declare arenas)
 - #159958 (Fix avoid cycle for self referential return type notation)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160144 (renovate: group lockfiles PRs)
 - #160149 (Fix Windows on Arm PAC default)
 - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160177 (A few more "predicate"-to-"clause" renamings)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
 - #160192 (Fix ICE for parsing issue with a closing brace)
 - #160209 (bootstrap: Remove method `Subcommand::kind`)
 - #160221 (Remove `Copy` supertrait from `VaList`)
 - #160223 (interpret: rename validate_operand → validate_place)
 - #160234 (Always use short ty path for call with missing arguments suggestion)
@rust-bors
rust-bors Bot merged commit 8310a37 into rust-lang:main Jul 31, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 31, 2026
rust-timer added a commit that referenced this pull request Jul 31, 2026
Rollup merge of #160031 - JohnTitor:vxworks-pread-pwrite-unsupported, r=Darksonn

std: make positioned I/O unsupported on VxWorks

Currently, build-std for VxWorks fails because std calls pread/pwrite for positioned I/O.
Previously libc defined them as shims, but recently these were removed to align the actual state of SDK: rust-lang/libc#5129
It should make sense to return an unsupported error for VxWorks.
Fix rust-lang/libc#5328
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Jul 31, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - rust-lang/rust#160204 (Sync from portable simd 2026 07 30)
 - rust-lang/rust#138230 (Add `raw_borrows_via_references` lint)
 - rust-lang/rust#158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - rust-lang/rust#160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one)
 - rust-lang/rust#160031 (std: make positioned I/O unsupported on VxWorks)
 - rust-lang/rust#160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - rust-lang/rust#160152 (Create on-demand CI job for testing EC2 instances)
 - rust-lang/rust#160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`)
 - rust-lang/rust#159214 (std: improve the documentation of the random feature)
 - rust-lang/rust#159818 (Resolve vars before calling `unnormalized_obligations`)
 - rust-lang/rust#159955 (Stop using higher-order macros to declare arenas)
 - rust-lang/rust#159958 (Fix avoid cycle for self referential return type notation)
 - rust-lang/rust#160040 (Split function parsing out of `item.rs` to a new module.)
 - rust-lang/rust#160044 (Add regression tests for fixed dead-code issues)
 - rust-lang/rust#160144 (renovate: group lockfiles PRs)
 - rust-lang/rust#160149 (Fix Windows on Arm PAC default)
 - rust-lang/rust#160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - rust-lang/rust#160175 (Try to recover less from incorrectly parsed const arg)
 - rust-lang/rust#160177 (A few more "predicate"-to-"clause" renamings)
 - rust-lang/rust#160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
 - rust-lang/rust#160192 (Fix ICE for parsing issue with a closing brace)
 - rust-lang/rust#160209 (bootstrap: Remove method `Subcommand::kind`)
 - rust-lang/rust#160221 (Remove `Copy` supertrait from `VaList`)
 - rust-lang/rust#160223 (interpret: rename validate_operand → validate_place)
 - rust-lang/rust#160234 (Always use short ty path for call with missing arguments suggestion)
@JohnTitor
JohnTitor deleted the vxworks-pread-pwrite-unsupported branch July 31, 2026 11:13
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.

libc 0.2.187 dropped pread/pwrite for vxworks, but std still imports them

3 participants