Skip to content

Commit 6f9c077

Browse files
authored
Rollup merge of rust-lang#124766 - devnexen:getrandom_solarish, r=Mark-Simulacrum
std::rand: adding solaris/illumos for getrandom support. To help solarish support for miri https://rust-lang/miri#3567
2 parents 378c8fc + c6dcb9d commit 6f9c077

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Diff for: std/src/sys/pal/unix/rand.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ mod imp {
5959
unsafe { getrandom(buf.as_mut_ptr().cast(), buf.len(), libc::GRND_NONBLOCK) }
6060
}
6161

62-
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd", netbsd10))]
62+
#[cfg(any(
63+
target_os = "espidf",
64+
target_os = "horizon",
65+
target_os = "freebsd",
66+
netbsd10,
67+
target_os = "illumos",
68+
target_os = "solaris"
69+
))]
6370
fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
6471
unsafe { libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
6572
}
@@ -83,6 +90,8 @@ mod imp {
8390
target_os = "horizon",
8491
target_os = "freebsd",
8592
target_os = "dragonfly",
93+
target_os = "solaris",
94+
target_os = "illumos",
8695
netbsd10
8796
)))]
8897
fn getrandom_fill_bytes(_buf: &mut [u8]) -> bool {
@@ -96,6 +105,8 @@ mod imp {
96105
target_os = "horizon",
97106
target_os = "freebsd",
98107
target_os = "dragonfly",
108+
target_os = "solaris",
109+
target_os = "illumos",
99110
netbsd10
100111
))]
101112
fn getrandom_fill_bytes(v: &mut [u8]) -> bool {

0 commit comments

Comments
 (0)