Skip to content

refactor: deprecate off64_t in VxWorks#5129

Open
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:vxworks-bit-width-transition
Open

refactor: deprecate off64_t in VxWorks#5129
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:vxworks-bit-width-transition

Conversation

@dybucc

@dybucc dybucc commented May 31, 2026

Copy link
Copy Markdown
Contributor

Description

As a follow up to #5127, this deprecates the same type on VxWorks. This continues the trend towards supporting a single 64-bit wide type for time and file offset values, instead of having suffixed variants (see more on that in the afore mentioned PR.) VxWorks does short work of it, because off_t is already defined with that bit-width.

While looking through the VxWorks headers, though, I noticed they support a 32-bit off_t whenever the system is not operating in user-land (with what they refer to as RTPs or Real Time Processes.) I can't include any sources because it's part of the downloadable SDK, but maybe this is worth considering. As per the GNU docs [1], the macro they check for to determine which definition should be made available is exposed when the -mrtp flag is issued during compilation. I haven't considered how would we detect this from the Rust side of things, though, or if we even want to.

Something else I wanted to note was that the VxWorks module seems to define functions that are not part of the VxWorks interface (based on the fact they're not declared within an extern block, and on both the comment that precedes them and the abasence of them in the downloadable SDK.) These use the suffixed variant of the off_t type, so I've had to annotate them with an allow(deprecated). Reading through the Linux manpage for those two routines, it may be that VxWorks has some register passing issues when running under x32, but that's just a personal hypothesis from the text and not something explicitly mentioned. It'd be great to get some outside input on this, as I'm not sure why we just reutrn the return value corresponding with an error, without attempting to also set errno (considering we pull the errno Rust crate and we're manually implementing these routines, this seems reasonable.)

Sources

  • Lines 23-26 of b_off_t.h under sysroot/usr/h/public/base in the VxWorks downloadable SDK for QEMU x86_64.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@dybucc dybucc force-pushed the vxworks-bit-width-transition branch 2 times, most recently from fb9aeb7 to 675bad7 Compare June 4, 2026 07:05
@rustbot

This comment has been minimized.

@dybucc dybucc force-pushed the vxworks-bit-width-transition branch from 675bad7 to 3d55d66 Compare June 9, 2026 07:14
@rustbot

This comment has been minimized.

@dybucc

dybucc commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

CI actually passes. There seems to be an issue with a glob import that is not used, but this has not
been changed in the patch (it's not even part of it, for that matter.) For some reason, rebasing
onto main with dependabot updates has ended up with a warning across all of my open PRs due to
that one (now apparently unused) import.

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jun 9, 2026
@dybucc dybucc force-pushed the vxworks-bit-width-transition branch from 3d55d66 to 04a0d17 Compare June 15, 2026 15:16
@rustbot

rustbot commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

This type, alongside aliases such as `time64_t`, are being deprecated in
favor of keeping a single, non-suffixed type that is 64-bits wide.

In VxWorks, `off64_t` already depends on `off_t`, so deprecating it
makes the transition to `off_t` easier.
@dybucc dybucc force-pushed the vxworks-bit-width-transition branch from 04a0d17 to 6b96768 Compare June 15, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants