Skip to content

Commit

Permalink
Auto merge of #3090 - josephlr:solaris, r=JohnTitor
Browse files Browse the repository at this point in the history
Solaris/Illumos: use correct types for getrandom(2) flags

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, there weren't any Solaris/Illumos files under `libc-test/semver`.

Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
bors committed Jan 28, 2023
2 parents d1eb3e8 + 328d723 commit 4d072b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,8 @@ pub const FILENAME_MAX: ::c_uint = 1024;
pub const L_tmpnam: ::c_uint = 25;
pub const TMP_MAX: ::c_uint = 17576;

pub const GRND_NONBLOCK: ::c_int = 0x0001;
pub const GRND_RANDOM: ::c_int = 0x0002;
pub const GRND_NONBLOCK: ::c_uint = 0x0001;
pub const GRND_RANDOM: ::c_uint = 0x0002;

pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
Expand Down

0 comments on commit 4d072b0

Please sign in to comment.