Skip to content

Commit 887775d

Browse files
authored
Add rdrand backend for Motor OS (#797)
1 parent 2e35077 commit 887775d

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- `RawOsError` type alias [#739]
1111
- `SysRng` behind new feature `sys_rng` [#751]
1212
- WASIp3 support [#779]
13+
- Motor OS support [#797]
1314

1415
### Changed
1516
- Use Edition 2024 and MSRV 1.85 [#749]

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ check-cfg = [
100100
'cfg(getrandom_test_linux_without_fallback)',
101101
'cfg(getrandom_test_netbsd_fallback)',
102102
'cfg(target_os, values("cygwin"))', # TODO(MSRV 1.86): Remove this.
103+
'cfg(target_os, values("motor"))',
103104
]
104105

105106
[lints.rust]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ fn get_random_u128() -> Result<u128, getrandom::Error> {
7070
| QNX Neutrino | `*‑nto-qnx*` | [`/dev/urandom`][14] (identical to `/dev/random`)
7171
| AIX | `*-ibm-aix` | [`/dev/urandom`][15]
7272
| Cygwin | `*-cygwin` | [`getrandom`][20] (based on [`RtlGenRandom`])
73+
| Motor OS | `x86_64-unknown-motor` | [`RDRAND`]
7374

7475
Pull Requests that add support for new targets to `getrandom` are always welcome.
7576

src/backends.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ cfg_if! {
149149
} else if #[cfg(target_os = "hermit")] {
150150
mod hermit;
151151
pub use hermit::*;
152+
} else if #[cfg(all(target_arch = "x86_64", target_os = "motor"))] {
153+
mod rdrand;
154+
pub use rdrand::*;
152155
} else if #[cfg(target_os = "vxworks")] {
153156
mod vxworks;
154157
pub use vxworks::*;

0 commit comments

Comments
 (0)