Skip to content

Conversation

@joboet
Copy link
Member

@joboet joboet commented Aug 4, 2024

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

@joboet joboet added the O-unix Operating system: Unix-like label Aug 4, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2024

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 4, 2024
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
@joboet joboet force-pushed the play_with_the_dice branch from b80ec51 to 207ee73 Compare August 4, 2024 16:40
@joboet joboet force-pushed the play_with_the_dice branch from 51743c9 to 99c0d76 Compare August 12, 2024 08:23
Copy link
Member

@ChrisDenton ChrisDenton left a 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.

@ChrisDenton
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 12, 2024

📌 Commit 99c0d76 has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2024
@bors bors merged commit c977deb into rust-lang:master Aug 13, 2024
@rustbot rustbot added this to the 1.82.0 milestone Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants