-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add arc4random and arc4random_buf to NuttX #4464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+2
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Declare `arc4random` and `arc4random_buf` as extern "C" functions in the NuttX module * Enable access to system-provided random number generation for NuttX targets * Aligns NuttX FFI with other Unix platforms that expose these functions This change allows Rust code targeting NuttX to use `arc4random` and `arc4random_buf` for secure random number generation, improving compatibility and feature parity with other targets.
tgross35
approved these changes
May 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Jun 1, 2025
* Declare `arc4random` and `arc4random_buf` as extern "C" functions in the NuttX module * Enable access to system-provided random number generation for NuttX targets * Aligns NuttX FFI with other Unix platforms that expose these functions This change allows Rust code targeting NuttX to use `arc4random` and `arc4random_buf` for secure random number generation, improving compatibility and feature parity with other targets. (backport <rust-lang#4464>) (cherry picked from commit f8e4746)
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Jun 1, 2025
* Declare `arc4random` and `arc4random_buf` as extern "C" functions in the NuttX module * Enable access to system-provided random number generation for NuttX targets * Aligns NuttX FFI with other Unix platforms that expose these functions This change allows Rust code targeting NuttX to use `arc4random` and `arc4random_buf` for secure random number generation, improving compatibility and feature parity with other targets. (backport <rust-lang#4464>) (cherry picked from commit f8e4746)
Merged
DorianNiemiecSVRJS
pushed a commit
to DorianNiemiecSVRJS/rust-libc
that referenced
this pull request
Jun 21, 2025
* Declare `arc4random` and `arc4random_buf` as extern "C" functions in the NuttX module * Enable access to system-provided random number generation for NuttX targets * Aligns NuttX FFI with other Unix platforms that expose these functions This change allows Rust code targeting NuttX to use `arc4random` and `arc4random_buf` for secure random number generation, improving compatibility and feature parity with other targets. (backport <rust-lang#4464>) (cherry picked from commit f8e4746)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jul 12, 2025
std: move NuttX to use arc4random for random number generation arc4random support in libc merged in rust-lang/libc#4464, so: * 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.
fmease
added a commit
to fmease/rust
that referenced
this pull request
Jul 13, 2025
std: move NuttX to use arc4random for random number generation arc4random support in libc merged in rust-lang/libc#4464, so: * 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.
rust-timer
added a commit
to rust-lang/rust
that referenced
this pull request
Jul 13, 2025
Rollup merge of #143776 - no1wudi:fix, r=tgross35 std: move NuttX to use arc4random for random number generation arc4random support in libc merged in rust-lang/libc#4464, so: * 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.
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jul 14, 2025
std: move NuttX to use arc4random for random number generation arc4random support in libc merged in rust-lang/libc#4464, so: * 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
O-unix
S-waiting-on-review
stable-applied
This PR has been cherry-picked to libc's stable release branch
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
arc4random
andarc4random_buf
as extern "C" functions in the NuttX moduleThis change allows Rust code targeting NuttX to use
arc4random
andarc4random_buf
for secure random number generation, improving compatibility and feature parity with other targets.Sources
https://github.com/apache/nuttx/blob/302ceb701b2d28ab16aa421e2dc5c70ec0dd594e/include/stdlib.h#L155-L156
@rustbot label +stable-nominated
Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI