-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
std: refactor UNIX random data generation #128655
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
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
ChrisDenton
left a comment
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+ |
This PR makes a number of changes to the UNIX randomness implementation:
io::Errorfor centralized error handlinggetrandom-specific modulelibcOnceLockto cache the random device file descriptor