Skip to content

Commit 0748462

Browse files
committed
std: move NuttX to use arc4random for random number generation
* Move `target_os = "nuttx"` from unix_legacy to arc4random section * This aligns NuttX with other POSIX-compliant systems that support arc4random * Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
1 parent 04a67d5 commit 0748462

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/sys/random

1 file changed

+1
-1
lines changed

library/std/src/sys/random/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ cfg_if::cfg_if! {
2020
target_os = "rtems",
2121
target_os = "solaris",
2222
target_os = "vita",
23+
target_os = "nuttx",
2324
))] {
2425
mod arc4random;
2526
pub use arc4random::fill_bytes;
@@ -44,7 +45,6 @@ cfg_if::cfg_if! {
4445
target_os = "hurd",
4546
target_os = "l4re",
4647
target_os = "nto",
47-
target_os = "nuttx",
4848
))] {
4949
mod unix_legacy;
5050
pub use unix_legacy::fill_bytes;

0 commit comments

Comments
 (0)