diff options
| author | David Carlier <devnexen@gmail.com> | 2024-03-03 15:25:52 +0000 |
|---|---|---|
| committer | David Carlier <devnexen@gmail.com> | 2024-03-03 15:27:35 +0000 |
| commit | d416a22e8a243e36ff88d18b5773df04daea1f71 (patch) | |
| tree | 6dd7216a8887f2f7eb98ab51d9de3eebf44d08e9 | |
| parent | e612d079a1102803fd2cae5dcd7f7f277e493b8e (diff) | |
| download | rust-d416a22e8a243e36ff88d18b5773df04daea1f71.tar.gz rust-d416a22e8a243e36ff88d18b5773df04daea1f71.zip | |
std::rand: enable getrandom for dragonflybsd too.
| -rw-r--r-- | library/std/src/sys/pal/unix/rand.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/library/std/src/sys/pal/unix/rand.rs b/library/std/src/sys/pal/unix/rand.rs index 5c32957bc51..c9ed6825f6c 100644 --- a/library/std/src/sys/pal/unix/rand.rs +++ b/library/std/src/sys/pal/unix/rand.rs @@ -62,7 +62,13 @@ mod imp { 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 @@ mod imp { 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 @@ mod imp { target_os = "espidf", target_os = "horizon", target_os = "freebsd", + target_os = "dragonfly", netbsd10 ))] fn getrandom_fill_bytes(v: &mut [u8]) -> bool { |
