File tree 3 files changed +7
-2
lines changed
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 33
33
//! | Web Browser and Node.js | `wasm*‑*‑unknown` | [`Crypto.getRandomValues`] if available, then [`crypto.randomFillSync`] if on Node.js, see [WebAssembly support]
34
34
//! | SOLID | `*-kmc-solid_*` | `SOLID_RNG_SampleRandomBytes`
35
35
//! | Nintendo 3DS | `armv6k-nintendo-3ds` | [`getrandom`][1]
36
+ //! | QNX Neutrino | `*‑nto-qnx*` | `/dev/urandom` [Random on QNX][14]
36
37
//!
37
38
//! There is no blanket implementation on `unix` targets that reads from
38
39
//! `/dev/urandom`. This ensures all supported targets are using the recommended
160
161
//! [11]: https://docs.oracle.com/cd/E88353_01/html/E37841/getrandom-2.html
161
162
//! [12]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html
162
163
//! [13]: https://github.com/emscripten-core/emscripten/pull/12240
164
+ //! [14]: https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/r/random.html
163
165
//!
164
166
//! [`BCryptGenRandom`]: https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
165
167
//! [`Crypto.getRandomValues`]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues
@@ -209,7 +211,7 @@ pub use crate::error::Error;
209
211
// The function MUST NOT ever write uninitialized bytes into `dest`,
210
212
// regardless of what value it returns.
211
213
cfg_if ! {
212
- if #[ cfg( any( target_os = "haiku" , target_os = "redox" ) ) ] {
214
+ if #[ cfg( any( target_os = "haiku" , target_os = "redox" , target_os = "nto" ) ) ] {
213
215
mod util_libc;
214
216
#[ path = "use_file.rs" ] mod imp;
215
217
} else if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ const FILE_PATH: &str = "/dev/random\0";
30
30
target_os = "redox" ,
31
31
target_os = "dragonfly" ,
32
32
target_os = "haiku" ,
33
- target_os = "macos"
33
+ target_os = "macos" ,
34
+ target_os = "nto" ,
34
35
) ) ]
35
36
const FILE_PATH : & str = "/dev/urandom\0 " ;
36
37
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ cfg_if! {
26
26
use libc:: __error as errno_location;
27
27
} else if #[ cfg( target_os = "haiku" ) ] {
28
28
use libc:: _errnop as errno_location;
29
+ } else if #[ cfg( target_os = "nto" ) ] {
30
+ use libc:: __get_errno_ptr as errno_location;
29
31
} else if #[ cfg( all( target_os = "horizon" , target_arch = "arm" ) ) ] {
30
32
extern "C" {
31
33
// Not provided by libc: https://github.com/rust-lang/libc/issues/1995
You can’t perform that action at this time.
0 commit comments