Skip to content

Commit f0e2c05

Browse files
committed
std::rand: enable getrandom for dragonflybsd too.
1 parent e612d07 commit f0e2c05

File tree

1 file changed

+3
-1
lines changed
  • library/std/src/sys/pal/unix

1 file changed

+3
-1
lines changed

library/std/src/sys/pal/unix/rand.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mod imp {
6262
unsafe { getrandom(buf.as_mut_ptr().cast(), buf.len(), libc::GRND_NONBLOCK) }
6363
}
6464

65-
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd", netbsd10))]
65+
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd", target_os = "dragonfly", netbsd10))]
6666
fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
6767
unsafe { libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
6868
}
@@ -73,6 +73,7 @@ mod imp {
7373
target_os = "espidf",
7474
target_os = "horizon",
7575
target_os = "freebsd",
76+
target_os = "dragonfly",
7677
netbsd10
7778
)))]
7879
fn getrandom_fill_bytes(_buf: &mut [u8]) -> bool {
@@ -85,6 +86,7 @@ mod imp {
8586
target_os = "espidf",
8687
target_os = "horizon",
8788
target_os = "freebsd",
89+
target_os = "dragonfly",
8890
netbsd10
8991
))]
9092
fn getrandom_fill_bytes(v: &mut [u8]) -> bool {

0 commit comments

Comments
 (0)