12
12
//! | OpenBSD | `*‑openbsd` | [`getentropy`][7]
13
13
//! | NetBSD | `*‑netbsd` | [`getrandom`][16] if available, otherwise [`kern.arandom`][8]
14
14
//! | Dragonfly BSD | `*‑dragonfly` | [`getrandom`][9]
15
- //! | Solaris, illumos | `*‑solaris`, `*‑illumos` | [`getrandom`][11] if available, otherwise [`/dev/random`][12]
15
+ //! | Solaris | `*‑solaris` | [`getentropy`][11]
16
+ //! | Illumos | `*‑illumos` | [`getrandom`][12]
16
17
//! | Fuchsia OS | `*‑fuchsia` | [`cprng_draw`]
17
18
//! | Redox | `*‑redox` | `/dev/urandom`
18
19
//! | Haiku | `*‑haiku` | `/dev/urandom` (identical to `/dev/random`)
25
26
//! | WASI | `wasm32‑wasi` | [`random_get`]
26
27
//! | Web Browser and Node.js | `wasm*‑*‑unknown` | [`Crypto.getRandomValues`] if available, then [`crypto.randomFillSync`] if on Node.js, see [WebAssembly support]
27
28
//! | SOLID | `*-kmc-solid_*` | `SOLID_RNG_SampleRandomBytes`
28
- //! | Nintendo 3DS | `armv6k -nintendo-3ds` | [`getrandom`][1 ]
29
+ //! | Nintendo 3DS | `* -nintendo-3ds` | [`getrandom`][18 ]
29
30
//! | PS Vita | `*-vita-*` | [`getentropy`][13]
30
31
//! | QNX Neutrino | `*‑nto-qnx*` | [`/dev/urandom`][14] (identical to `/dev/random`)
31
32
//! | AIX | `*-ibm-aix` | [`/dev/urandom`][15]
32
33
//!
33
- //! There is no blanket implementation on `unix` targets that reads from
34
- //! `/dev/urandom`. This ensures all supported targets are using the recommended
35
- //! interface and respect maximum buffer sizes.
36
- //!
37
34
//! Pull Requests that add support for new targets to `getrandom` are always welcome.
38
35
//!
39
36
//! ## Unsupported targets
176
173
//! [7]: https://man.openbsd.org/getentropy.2
177
174
//! [8]: https://man.netbsd.org/sysctl.7
178
175
//! [9]: https://leaf.dragonflybsd.org/cgi/web-man?command=getrandom
179
- //! [11]: https://docs.oracle.com/cd/E88353_01/html/E37841/getrandom -2.html
180
- //! [12]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html
176
+ //! [11]: https://docs.oracle.com/cd/E88353_01/html/E37841/getentropy -2.html
177
+ //! [12]: https://illumos.org/man/2/getrandom
181
178
//! [13]: https://github.com/emscripten-core/emscripten/pull/12240
182
179
//! [14]: https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/r/random.html
183
180
//! [15]: https://www.ibm.com/docs/en/aix/7.3?topic=files-random-urandom-devices
184
181
//! [16]: https://man.netbsd.org/getrandom.2
185
182
//! [17]: https://www.gnu.org/software/libc/manual/html_mono/libc.html#index-getrandom
183
+ //! [18]: https://github.com/rust3ds/shim-3ds/commit/b01d2568836dea2a65d05d662f8e5f805c64389d
186
184
//!
187
185
//! [`BCryptGenRandom`]: https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
188
186
//! [`Crypto.getRandomValues`]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues
@@ -240,6 +238,7 @@ cfg_if! {
240
238
} else if #[ cfg( any(
241
239
target_os = "macos" ,
242
240
target_os = "openbsd" ,
241
+ target_os = "solaris" ,
243
242
target_os = "vita" ,
244
243
target_os = "emscripten" ,
245
244
) ) ] {
@@ -249,6 +248,7 @@ cfg_if! {
249
248
target_os = "dragonfly" ,
250
249
target_os = "freebsd" ,
251
250
target_os = "hurd" ,
251
+ target_os = "illumos" ,
252
252
// Check for target_arch = "arm" to only include the 3DS. Does not
253
253
// include the Nintendo Switch (which is target_arch = "aarch64").
254
254
all( target_os = "horizon" , target_arch = "arm" ) ,
@@ -302,10 +302,6 @@ cfg_if! {
302
302
} else if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
303
303
mod util_libc;
304
304
#[ path = "linux_android.rs" ] mod imp;
305
- } else if #[ cfg( any( target_os = "illumos" , target_os = "solaris" ) ) ] {
306
- mod util_libc;
307
- mod use_file;
308
- #[ path = "solaris_illumos.rs" ] mod imp;
309
305
} else if #[ cfg( target_os = "netbsd" ) ] {
310
306
mod util_libc;
311
307
#[ path = "netbsd.rs" ] mod imp;
0 commit comments