vxworks: add cfg to definition of off64_t and off_t#5129
Conversation
fb9aeb7 to
675bad7
Compare
This comment has been minimized.
This comment has been minimized.
675bad7 to
3d55d66
Compare
This comment has been minimized.
This comment has been minimized.
|
CI actually passes. There seems to be an issue with a glob import that is not used, but this has not |
3d55d66 to
04a0d17
Compare
This comment has been minimized.
This comment has been minimized.
04a0d17 to
6b96768
Compare
|
@rustbot blocked Holding off until there is a good alternative to off64_t |
|
(https://snoozeth.is/Pf0pTEeZDMs) I will wait until Wed, 19 Aug 2026 08:31:52 UTC and then add label S-waiting-on-review and remove label S-blocked. @rustbot claim. |
6b96768 to
1d99a12
Compare
This comment has been minimized.
This comment has been minimized.
1d99a12 to
0b3f97d
Compare
off64_t in VxWorkscfg to definition of off64_t and off_t
|
@tgross35 The PR has been updated. I don't think I can find a better solution. Both
@rustbot ready review |
| pub type off_t = c_longlong; | ||
| pub type off64_t = off_t; | ||
| cfg_if! { | ||
| if #[cfg(vxworks_rtp)] { | ||
| pub type off_t = c_longlong; | ||
| } else { | ||
| pub type off_t = c_long; | ||
| pub type off64_t = c_longlong; | ||
| } | ||
| } |
There was a problem hiding this comment.
Given the existing definitions seem to match rtp, could there be an assumption that vxworks builds are always targeting RTPs rather than kernel? I don't see it documented here https://doc.rust-lang.org/rustc/platform-support/vxworks.html but that's usually a reasonable assumption for most targets.
Cc maintainers @biabbas @hax0kartik
|
hi, thanks for the PR but we do not support rust in VxWorks kernel mode. I’m going to reject this change as the platform maintainer. |
|
Ack, thanks for taking a look! @dybucc this can probably be repurposed as a docs PR to help others in the future. We don't really have anything like this yet but I think the @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
Snooze cancelled. @rustbot release-assignment. |
0b3f97d to
ef3abc5
Compare
|
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. |
VxWorks compiles to RTPs and kernels. RTPs do not expose `off64_t`. Rust can not be used with VxWorks kernels. `off64_t` should not be part of the crate. Two polyfill routines were removed. They were stubs for errors. They did not set up `errno` either.
ef3abc5 to
df963e7
Compare
That's done now. The PR documents that. Kernel symbols are deprecated. This includes @rustbot ready |
| note = "Use `off_t` instead. This type does not exist. It's only present in VxWorks kernels. \ | ||
| Those are unsupported in Rust." |
There was a problem hiding this comment.
Simplify to something like "Kernel-mode definitions are not supported in VxWorks. Use off_t instead.". Otherwise LGTM.
| //! VxWorks allows compiling different types of programs. Exposed bindings are | ||
| //! with respect to RTPs. VxWorks kernel interfaces are not exposed. `off_t` is | ||
| //! an example of this. It's a `c_long` in kernels. It's a `c_longlong` in RTPs. |
There was a problem hiding this comment.
//! VxWorks allows compiling different types of programs but `libc` only supports
//! RTPs (real-time processes), not kernel interfaces. Bindings should match RTP
//! definitions when there is a discrepancy.
Dropping the concrete example
Description
This PR improves the definition of
off_t. This applies to targets whose operating system is VxWorks.The
libccrate definesoff_tas ac_longlong. This is only correct in programs compiled as RTPs. Programs compiled as VxWorks kernels are different. They exposeoff_tas ac_long.The
off64_type is not present in RTP processes.Automatic detection of this does not seem possible in Rust. A specific flag is issued to gcc to expose the feature test macro. This patch adds an equivalent
cfg. The crate user must manually set it.Two redundant routines were removed. These are explicitly out of the shipped SDK. It seems like the
libccrate had polyfills set up. These would always return an error value.Sources
sysroot/usr/h/public/base/b_off_t.h. This was found in the VxWorks downloadable SDK for QEMU x86_64.usr/3pp/develop/usr/include/python3.9/pyconfig.h. This was found in the same as SDK as quoted above. This defines certain included features.preadandpwriteare not defined.Checklist
libc-test/semverhave been updated*LASTor*MAXare included (see #3131)cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI@rustbot label +stable-nominated