Skip to content

Conversation

gautam899
Copy link

Hi, this adds required defines and functions for VxWorks. I have also added changes in libc-test required for vxworks

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

The new API is straightforward enough. However, could you explain the changes to existing API? There are a number of breaking changes here, e.g. time_t -> timespec, changing sched_param, changing start/len in flock, removing _realpath.

@hax0kartik
Copy link
Contributor

hax0kartik commented Aug 27, 2025

The new API is straightforward enough. However, could you explain the changes to existing API? There are a number of breaking changes here, e.g. time_t -> timespec, changing sched_param, changing start/len in flock, removing _realpath.

Hi Trevor, @gautam899 and I work on the same team and these changes have been done to better reflect what VxWorks internally has. VxWorks recently moved to nanosecond precision and as such there have a bunch of changes related to time_t and timespec(Compliance with POSIX.1-2008, https://man7.org/linux/man-pages/man3/stat.3type.html). For flock, the struct was incorrectly using long instead of long long which caused breakages on 32 bit platforms.

@tgross35
Copy link
Contributor

tgross35 commented Aug 27, 2025

Thank you for confirming that. _realpath and sa_u_t were removed then?

These seem like breaking changes in the C world as well, did they come with a new vxworks release? We currently document a minimum of 7, but that will need to be increased if std relies on anything here https://doc.rust-lang.org/beta/rustc/platform-support/vxworks.html. Or split the targets like for QNX. (Just trying to wrap my head around what exactly the changes here mean for users.)

flock makes sense, there is some history at #4043. That struct never actually made it to a release because of #4043 (comment), so the fix here seems correct, and what should have been added in the first place.

@hax0kartik
Copy link
Contributor

hax0kartik commented Aug 27, 2025

Thank you for confirming that. _realpath and sa_u_t were removed then?

These seem like breaking changes in the C world as well, did they come with a new vxworks release? We currently document a minimum of 7, but that will need to be increased if std relies on anything here https://doc.rust-lang.org/beta/rustc/platform-support/vxworks.html. Or split the targets like for QNX. (Just trying to wrap my head around what exactly the changes here mean for users.)

flock makes sense, there is some history at #4043. That struct never actually made it to a release because of #4043 (comment), so the fix here seems correct, and what should have been added in the first place.

Yes, with vxworks 7 25.09 release, _realpath was made private, and the changes related to timespec were done. The reason behind removing sa_u_t is pretty much the same as #4249.

We are also working on upstreaming the standard library patches which will require these changes. I think we should update that document to reflect the minimum supported release id as well. (For eg, VxWorks 7 25.09 instead of just VxWorks 7)

E: From the customer's POV, they will no longer be able to compile their code if it used the older version of stat for example. But I think we can explicitly mention in release doc notes for VxWorks that only v0.2.175 of the libc crate will work for release versions lower than 25.09. (We already publish breaking changes in VxWorks release notes). That being said, I am opposed to making multiple files for different versions as this is not a major version change (7 -> 8). I think this situation can be rectified by providing proper documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants