Skip to content

Commit 6c81340

Browse files
Rollup merge of rust-lang#132048 - mustartt:aix-random-impl, r=workingjubilee
AIX: use /dev/urandom for random implementation On AIX, we can poll `/dev/urandom` for cryptographically secure random output to implement `fill_bytes` because we don't have equivalent syscalls like other platforms. https://www.ibm.com/docs/en/aix/7.3?topic=files-random-urandom-devices
2 parents 980e5a2 + 5c416b4 commit 6c81340

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

std/src/random.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::sys::random as sys;
3838
/// Vita | `arc4random_buf`
3939
/// Hermit | `read_entropy`
4040
/// Horizon | `getrandom` shim
41-
/// Hurd, L4Re, QNX | `/dev/urandom`
41+
/// AIX, Hurd, L4Re, QNX | `/dev/urandom`
4242
/// Redox | `/scheme/rand`
4343
/// RTEMS | [`arc4random_buf`](https://docs.rtems.org/branches/master/bsp-howto/getentropy.html)
4444
/// SGX | [`rdrand`](https://en.wikipedia.org/wiki/RDRAND)

std/src/sys/random/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cfg_if::cfg_if! {
4040
mod horizon;
4141
pub use horizon::fill_bytes;
4242
} else if #[cfg(any(
43+
target_os = "aix",
4344
target_os = "hurd",
4445
target_os = "l4re",
4546
target_os = "nto",

0 commit comments

Comments
 (0)