|
49 | 49 | //! |
50 | 50 | //! ## `/dev/urandom` fallback on Linux and Android |
51 | 51 | //! |
52 | | -//! On Linux targets the fallback is present only for the following `target_arch`es: |
53 | | -//! `aarch64`, `arm`, `powerpc`, `powerpc64`, `s390x`, `x86`, `x86_64`. Other supported |
54 | | -//! `target_arch`es [require](https://doc.rust-lang.org/stable/rustc/platform-support.html) |
| 52 | +//! On Linux targets the fallback is present only if either `target_env` is `musl`, |
| 53 | +//! or `target_arch` is one of the following: `aarch64`, `arm`, `powerpc`, `powerpc64`, |
| 54 | +//! `s390x`, `x86`, `x86_64`. Other supported targets [require][platform-support] |
55 | 55 | //! kernel versions which support `getrandom` system call, so fallback is not needed. |
56 | 56 | //! |
57 | 57 | //! On Android targets the fallback is present only for the following `target_arch`es: |
|
200 | 200 | //! [CommonJS modules]: https://nodejs.org/api/modules.html |
201 | 201 | //! [ES modules]: https://nodejs.org/api/esm.html |
202 | 202 | //! [`sys_read_entropy`]: https://github.com/hermit-os/kernel/blob/315f58ff5efc81d9bf0618af85a59963ff55f8b1/src/syscalls/entropy.rs#L47-L55 |
| 203 | +//! [platform-support]: https://doc.rust-lang.org/stable/rustc/platform-support.html |
203 | 204 |
|
204 | 205 | #![doc( |
205 | 206 | html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", |
206 | 207 | html_favicon_url = "https://www.rust-lang.org/favicon.ico", |
207 | | - html_root_url = "https://docs.rs/getrandom/0.2.13" |
| 208 | + html_root_url = "https://docs.rs/getrandom/0.2.14" |
208 | 209 | )] |
209 | 210 | #![no_std] |
210 | 211 | #![warn(rust_2018_idioms, unused_lifetimes, missing_docs)] |
@@ -270,6 +271,10 @@ cfg_if! { |
270 | 271 | target_arch = "s390x", |
271 | 272 | target_arch = "x86", |
272 | 273 | target_arch = "x86_64", |
| 274 | + // Minimum supported Linux kernel version for MUSL targets |
| 275 | + // is not specified explicitly (as of Rust 1.77) and they |
| 276 | + // are used in practice to target pre-3.17 kernels. |
| 277 | + target_env = "musl", |
273 | 278 | ), |
274 | 279 | ) |
275 | 280 | ), |
|
0 commit comments