mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
std::rand: enable getrandom for dragonflybsd too.
This commit is contained in:
@@ -62,7 +62,13 @@ fn getrandom(
|
||||
unsafe { getrandom(buf.as_mut_ptr().cast(), buf.len(), libc::GRND_NONBLOCK) }
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd", netbsd10))]
|
||||
#[cfg(any(
|
||||
target_os = "espidf",
|
||||
target_os = "horizon",
|
||||
target_os = "freebsd",
|
||||
target_os = "dragonfly",
|
||||
netbsd10
|
||||
))]
|
||||
fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
|
||||
unsafe { libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
|
||||
}
|
||||
@@ -73,6 +79,7 @@ fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
|
||||
target_os = "espidf",
|
||||
target_os = "horizon",
|
||||
target_os = "freebsd",
|
||||
target_os = "dragonfly",
|
||||
netbsd10
|
||||
)))]
|
||||
fn getrandom_fill_bytes(_buf: &mut [u8]) -> bool {
|
||||
@@ -85,6 +92,7 @@ fn getrandom_fill_bytes(_buf: &mut [u8]) -> bool {
|
||||
target_os = "espidf",
|
||||
target_os = "horizon",
|
||||
target_os = "freebsd",
|
||||
target_os = "dragonfly",
|
||||
netbsd10
|
||||
))]
|
||||
fn getrandom_fill_bytes(v: &mut [u8]) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user