11
11
//! | FreeBSD | `*‑freebsd` | [`getrandom`][5] if available, otherwise [`kern.arandom`][6]
12
12
//! | OpenBSD | `*‑openbsd` | [`getentropy`][7]
13
13
//! | NetBSD | `*‑netbsd` | [`getrandom`][16] if available, otherwise [`kern.arandom`][8]
14
- //! | Dragonfly BSD | `*‑dragonfly` | [`getrandom`][9] if available, otherwise [`/dev/urandom`][10] (identical to `/dev/random`)
14
+ //! | Dragonfly BSD | `*‑dragonfly` | [`getrandom`][9]
15
15
//! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom`][11] if available, otherwise [`/dev/random`][12]
16
16
//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`]
17
17
//! | Redox | `*‑redox` | `/dev/urandom`
177
177
//! [7]: https://man.openbsd.org/getentropy.2
178
178
//! [8]: https://man.netbsd.org/sysctl.7
179
179
//! [9]: https://leaf.dragonflybsd.org/cgi/web-man?command=getrandom
180
- //! [10]: https://leaf.dragonflybsd.org/cgi/web-man?command=random§ion=4
181
180
//! [11]: https://docs.oracle.com/cd/E88353_01/html/E37841/getrandom-2.html
182
181
//! [12]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html
183
182
//! [13]: https://github.com/emscripten-core/emscripten/pull/12240
@@ -239,6 +238,15 @@ cfg_if! {
239
238
if #[ cfg( any( target_os = "haiku" , target_os = "redox" , target_os = "nto" , target_os = "aix" ) ) ] {
240
239
mod util_libc;
241
240
#[ path = "use_file.rs" ] mod imp;
241
+ } else if #[ cfg( any(
242
+ target_os = "dragonfly" ,
243
+ target_os = "hurd" ,
244
+ // Check for target_arch = "arm" to only include the 3DS. Does not
245
+ // include the Nintendo Switch (which is target_arch = "aarch64").
246
+ all( target_os = "horizon" , target_arch = "arm" ) ,
247
+ ) ) ] {
248
+ mod util_libc;
249
+ #[ path = "getrandom.rs" ] mod imp;
242
250
} else if #[ cfg( all(
243
251
not( feature = "linux_disable_fallback" ) ,
244
252
any(
@@ -293,10 +301,6 @@ cfg_if! {
293
301
} else if #[ cfg( any( target_os = "freebsd" , target_os = "netbsd" ) ) ] {
294
302
mod util_libc;
295
303
#[ path = "bsd_arandom.rs" ] mod imp;
296
- } else if #[ cfg( target_os = "dragonfly" ) ] {
297
- mod util_libc;
298
- mod use_file;
299
- #[ path = "dragonfly.rs" ] mod imp;
300
304
} else if #[ cfg( target_os = "fuchsia" ) ] {
301
305
#[ path = "fuchsia.rs" ] mod imp;
302
306
} else if #[ cfg( any( target_os = "ios" , target_os = "visionos" , target_os = "watchos" , target_os = "tvos" ) ) ] {
@@ -320,11 +324,6 @@ cfg_if! {
320
324
#[ path = "espidf.rs" ] mod imp;
321
325
} else if #[ cfg( windows) ] {
322
326
#[ path = "windows.rs" ] mod imp;
323
- } else if #[ cfg( all( target_os = "horizon" , target_arch = "arm" ) ) ] {
324
- // We check for target_arch = "arm" because the Nintendo Switch also
325
- // uses Horizon OS (it is aarch64).
326
- mod util_libc;
327
- #[ path = "3ds.rs" ] mod imp;
328
327
} else if #[ cfg( target_os = "vita" ) ] {
329
328
mod util_libc;
330
329
#[ path = "vita.rs" ] mod imp;
@@ -342,9 +341,6 @@ cfg_if! {
342
341
any( target_arch = "wasm32" , target_arch = "wasm64" ) ,
343
342
target_os = "unknown" ) ) ] {
344
343
#[ path = "js.rs" ] mod imp;
345
- } else if #[ cfg( target_os = "hurd" ) ] {
346
- mod util_libc;
347
- #[ path = "hurd.rs" ] mod imp;
348
344
} else if #[ cfg( feature = "custom" ) ] {
349
345
use custom as imp;
350
346
} else if #[ cfg( all( any( target_arch = "wasm32" , target_arch = "wasm64" ) ,
0 commit comments