-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Revert of mut api changes breaking rust userspace on AIX #4544
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
base: main
Are you sure you want to change the base?
Conversation
This is tricky. We really need to match the platform API for forward compatibility, but at the same time it would be pretty awful if Cc @xingxue-ibm, @gilamn5tr since #4450 is the referenced commit.
Is this something in the process of changing? |
I am just third party user not affiliated to the IBM. Maybe IBM maintainers here could tell better. I think it might be leftover from pre ANSI C, not that those headers are require non const pointers in C. For me biggest problem, that many rust user libs expect consts here. Like simple networking libraries using c:statfs path fails because AIX backend in this library his does not wrap Maybe @xingxue-ibm OP of the original commit can guide us here? |
To clarify: the best case scenario here is that AIX maintainers (1) confirm the arguments can safely be pointers to read-only data, and (2) are willing to update the documentation / headers to reflect that. I am willing to merge this PR with only the maintainer confirmation, the docs update would just be nice to make things more clear for the future (and of course to help other consumers of those docs).
This would not happen, |
@tgross35 OK, I do not question policy of this library, anyway still it would be nice to know what is actually going here from AIX api side. I found this issue from higher level wrapper (namely rustix) and if that the case mutable is needed here, these platform differences could be resolved at those higher level libraries. Actually I am trying to extend rustix cover aix. But this const -> mut thing caught my eye on libc. I would prefer that api would not be mutable only because some obscure historical reason without the real need of mutability. |
There are worse type mismatches than consts, example ioctls are broken as constants now are long, but ioctl symbol expects int...:
|
Description
Reverted C api changes introduced by commit c192a5c
IBM AIX does not define pointer constness traditionally in their headers. Some commit changed const pointers to mutable ones, those breaking many userspace libraries, as those in rust libc are usually defined on other posix platforms as const.
Some older commit (mainly c192a5c) changed the api.
I reverted fstat, swapon apis, to expose path variable pointer as const again.
Sources
https://www.ibm.com/docs/en/aix/7.2.0?topic=s-stat-fstat-lstat-statx-fstatx-statxat-fstatat-fullstat-ffullstat-stat64-fstat64-lstat64-stat64x-fstat64x-lstat64x-stat64xat-subroutine)
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
@rustbot label +stable-nominated