-
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
Solaris/Illumos: use correct types for getrandom(2) flags #3090
Conversation
On Solaris (and any other platform that supports it), the `getrandom(2)` syscall has signature: ```rust fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ``` so the flag constants (`GRND_NONBLOCK`, `GRND_RANDOM`, etc...) should be of type `c_uint`. I'm not sure if this sort of "bug fix" counts as a breaking change. Signed-off-by: Joe Richey <joerichey@google.com>
r? @JohnTitor (rustbot has picked a reviewer for you, use r? to override) |
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.
This looks right to me, and critically brings this platform into line with all the other ones, which was our intent at the OS level when we added this interface with a matching signature. I think it regrettably suggests nobody actually compiled and used the code in the original PR that added these.
I've actually been using these flags in the |
Thanks for the explanation! It makes sense to call it a bug fix if it currently needs an assertion. |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
1 similar comment
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
On Solaris (and any other platform that supports it), the
getrandom(2)
syscall has signature:so the flag constants (
GRND_NONBLOCK
,GRND_RANDOM
, etc...) should be of typec_uint
.I'm not sure if this sort of "bug fix" counts as a breaking change, there weren't any Solaris/Illumos files under
libc-test/semver
.Signed-off-by: Joe Richey joerichey@google.com