1111//! | FreeBSD | `*‑freebsd` | [`getrandom`][5] if available, otherwise [`kern.arandom`][6]
1212//! | OpenBSD | `*‑openbsd` | [`getentropy`][7]
1313//! | 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]
1515//! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom`][11] if available, otherwise [`/dev/random`][12]
1616//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`]
1717//! | Redox | `*‑redox` | `/dev/urandom`
177177//! [7]: https://man.openbsd.org/getentropy.2
178178//! [8]: https://man.netbsd.org/sysctl.7
179179//! [9]: https://leaf.dragonflybsd.org/cgi/web-man?command=getrandom
180- //! [10]: https://leaf.dragonflybsd.org/cgi/web-man?command=random§ion=4
181180//! [11]: https://docs.oracle.com/cd/E88353_01/html/E37841/getrandom-2.html
182181//! [12]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html
183182//! [13]: https://github.com/emscripten-core/emscripten/pull/12240
@@ -239,6 +238,15 @@ cfg_if! {
239238 if #[ cfg( any( target_os = "haiku" , target_os = "redox" , target_os = "nto" , target_os = "aix" ) ) ] {
240239 mod util_libc;
241240 #[ 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;
242250 } else if #[ cfg( all(
243251 not( feature = "linux_disable_fallback" ) ,
244252 any(
@@ -293,10 +301,6 @@ cfg_if! {
293301 } else if #[ cfg( any( target_os = "freebsd" , target_os = "netbsd" ) ) ] {
294302 mod util_libc;
295303 #[ 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;
300304 } else if #[ cfg( target_os = "fuchsia" ) ] {
301305 #[ path = "fuchsia.rs" ] mod imp;
302306 } else if #[ cfg( any( target_os = "ios" , target_os = "visionos" , target_os = "watchos" , target_os = "tvos" ) ) ] {
@@ -320,11 +324,6 @@ cfg_if! {
320324 #[ path = "espidf.rs" ] mod imp;
321325 } else if #[ cfg( windows) ] {
322326 #[ 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;
328327 } else if #[ cfg( target_os = "vita" ) ] {
329328 mod util_libc;
330329 #[ path = "vita.rs" ] mod imp;
@@ -342,9 +341,6 @@ cfg_if! {
342341 any( target_arch = "wasm32" , target_arch = "wasm64" ) ,
343342 target_os = "unknown" ) ) ] {
344343 #[ path = "js.rs" ] mod imp;
345- } else if #[ cfg( target_os = "hurd" ) ] {
346- mod util_libc;
347- #[ path = "hurd.rs" ] mod imp;
348344 } else if #[ cfg( feature = "custom" ) ] {
349345 use custom as imp;
350346 } else if #[ cfg( all( any( target_arch = "wasm32" , target_arch = "wasm64" ) ,
0 commit comments