-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flock for vxworks using ioctl #4043
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @tgross35 (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, I implemented the suggested changes and will proceed to have the @rustbot review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, this looks good to me. I'll give another day or so for someone more familiar with vxworks to take a look before merging.
Please squash when you get the chance.
393cba1
to
19a8526
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are five fields in struct flock:
l_type
(short), l_whence
(short), l_start
(long long), l_len
(long long) and l_pid
(long).
Regards,
Hey @biabbas! We must both be looking at a different revision of the same file. See the snippet below of what the
|
Is this saying there is a change to make here? Just @rustbot author |
19a8526
to
1256e15
Compare
Thanks @jackorobot for authoring and @biabbas for taking a look. I don't know much about vxworks but is it possible you are looking at headers for 32-bit vs 64-bit? The two mentioned definitions are compatible for the lower four fields on LP64, but not on ILP32. |
I'm going to hold off on backporting actually until confirming the above. Would you both mind mentioning what target and vxworks versions the headers you're referencing are from? If it's a difference in version then we should just add the latest, but I don't want to give 32-bit users unsound API if that's what the difference is. |
@tgross35 The snippet I sent earlier is from an VxWorks 7 distribution, which I use on a |
I referred the latest vxworks sources, I found only one header file with this definition for for all targets. I also checked the previous vxworks 7 versions but the definitions remained same. I'll check again tomorrow and confirm. |
I checked on different targets with the latest source, the struct flock declaration in fcntlcom.h remained the same. |
Thanks for checking, this makes no sense. As a last effort to explain things, is it possible to build a program both for i686 and x86_64 and print that? Something like
VxWorks doesn't do API versioning separate from OS version, do they? In any case I'll backport this as long as neither of you have objections, but will add a |
@tgross35,
But on 32 bits long long is 8 bytes and long is 4 bytes. c_long is 4 bytes for 32 bit targets. This would indeed cause problems for 32 bit targets.
I don't think we should be releasing these changes. |
@jackorobot Could you use |
I am not sure what to tell you other than that the struct I based this on the version of Maybe it is because the niche platform I am looking at, and if @biabbas has more versions that confirm the |
Are there more specific version numbers? Aiui vxworks 7 has been around since 2010 |
I have access to almost all VxWorks versions. I checked the early VxWorks 7versions and VxWorks 6 versions too, but the definition was the same as in the latest 24.03 version. |
@biabbas It is 23.09. But it is supplied to us by some equipment manufacturer, and I would not be surprised if they (for backwards compatibility) supply very old header file versions (with dates from 1999 etc...) |
Not exactly. It is still in the |
Description
Added an implementation for
flock
for vxworks target. Vxworks only suppliesioctl
, but it does have allflock
related#define
s available.Sources
Vxworks headers are copyrighted, however this is based on:
ioLib.h
andsys/fcntlcom.h
Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI
Note that testing seems to not be available for the vxworks target