diff options
| author | Jan Sommer <jan.sommer@dlr.de> | 2024-10-16 10:48:07 +0200 |
|---|---|---|
| committer | Jan Sommer <jan.sommer@dlr.de> | 2024-10-18 10:26:59 +0200 |
| commit | e20636a78621d823334f3114d5d49ab8a442dfa3 (patch) | |
| tree | 89b92a0de63e2ecd5347b11094349ade0281241b | |
| parent | db8043bb199705e72246ca43d4af1e9dbe7d55be (diff) | |
| download | rust-e20636a78621d823334f3114d5d49ab8a442dfa3.tar.gz rust-e20636a78621d823334f3114d5d49ab8a442dfa3.zip | |
Add entropy source for RTEMS
| -rw-r--r-- | library/std/src/random.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/random/arc4random.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/random/mod.rs | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/random.rs b/library/std/src/random.rs index 604fa4df110..cdb88c795bf 100644 --- a/library/std/src/random.rs +++ b/library/std/src/random.rs @@ -40,6 +40,7 @@ use crate::sys::random as sys; /// Horizon | `getrandom` shim /// Hurd, L4Re, QNX | `/dev/urandom` /// Redox | `/scheme/rand` +/// RTEMS | [`arc4random_buf`](https://docs.rtems.org/branches/master/bsp-howto/getentropy.html) /// SGX | [`rdrand`](https://en.wikipedia.org/wiki/RDRAND) /// SOLID | `SOLID_RNG_SampleRandomBytes` /// TEEOS | `TEE_GenerateRandom` diff --git a/library/std/src/sys/random/arc4random.rs b/library/std/src/sys/random/arc4random.rs index 32467e9ebaa..ffabaafbee8 100644 --- a/library/std/src/sys/random/arc4random.rs +++ b/library/std/src/sys/random/arc4random.rs @@ -12,6 +12,7 @@ #[cfg(not(any( target_os = "haiku", target_os = "illumos", + target_os = "rtems", target_os = "solaris", target_os = "vita", )))] @@ -21,6 +22,7 @@ use libc::arc4random_buf; #[cfg(any( target_os = "haiku", // See https://git.haiku-os.org/haiku/tree/headers/compatibility/bsd/stdlib.h target_os = "illumos", // See https://www.illumos.org/man/3C/arc4random + target_os = "rtems", // See https://docs.rtems.org/branches/master/bsp-howto/getentropy.html target_os = "solaris", // See https://docs.oracle.com/cd/E88353_01/html/E37843/arc4random-3c.html target_os = "vita", // See https://github.com/vitasdk/newlib/blob/b89e5bc183b516945f9ee07eef483ecb916e45ff/newlib/libc/include/stdlib.h#L74 ))] diff --git a/library/std/src/sys/random/mod.rs b/library/std/src/sys/random/mod.rs index d625814d15b..edc2cacdfd8 100644 --- a/library/std/src/sys/random/mod.rs +++ b/library/std/src/sys/random/mod.rs @@ -17,6 +17,7 @@ cfg_if::cfg_if! { target_os = "illumos", target_os = "netbsd", target_os = "openbsd", + target_os = "rtems", target_os = "solaris", target_os = "vita", ))] { |
