-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
std: refactor UNIX random data generation #128655
Conversation
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
This PR makes a number of changes to the UNIX randomness implementation: * Use `io::Error` for centralized error handling * Move the file-fallback logic out of the `getrandom`-specific module * Stop redefining the syscalls on macOS and DragonFly, they have appeared in `libc` * Add a `OnceLock` to cache the random device file descriptor
b80ec51
to
207ee73
Compare
51743c9
to
99c0d76
Compare
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.
LGTM. I've left some comments but these are just some notes to myself while I was reviewing. I do have one query but nothing that should block merging.
@bors r+ |
…Denton std: refactor UNIX random data generation This PR makes a number of changes to the UNIX randomness implementation: * Use `io::Error` for centralized error handling * Move the file-fallback logic out of the `getrandom`-specific module * Stop redefining the syscalls on macOS and DragonFly, they have appeared in `libc` * Add a `OnceLock` to cache the random device file descriptor
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#128643 (Refactor `powerpc64` call ABI handling) - rust-lang#128655 (std: refactor UNIX random data generation) - rust-lang#128745 (Remove unused lifetime parameter from spawn_unchecked) - rust-lang#128841 (bootstrap: don't use rustflags for `--rustc-args`) - rust-lang#128983 (Slightly refactor `TargetSelection` in bootstrap) - rust-lang#129026 (CFI: Move CFI ui tests to cfi directory) - rust-lang#129040 (Fix blessing of rmake tests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128655 - joboet:play_with_the_dice, r=ChrisDenton std: refactor UNIX random data generation This PR makes a number of changes to the UNIX randomness implementation: * Use `io::Error` for centralized error handling * Move the file-fallback logic out of the `getrandom`-specific module * Stop redefining the syscalls on macOS and DragonFly, they have appeared in `libc` * Add a `OnceLock` to cache the random device file descriptor
This PR makes a number of changes to the UNIX randomness implementation:
io::Error
for centralized error handlinggetrandom
-specific modulelibc
OnceLock
to cache the random device file descriptor