Skip to content
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

Use getentropy(2) on macos #70207

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Use getentropy(2) on macos #70207

merged 1 commit into from
Mar 23, 2020

Conversation

hatoo
Copy link
Contributor

@hatoo hatoo commented Mar 21, 2020

resolves #70179

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2020
@Mark-Simulacrum
Copy link
Member

This seems to be what the getrandom crate does as of rust-random/getrandom#46, and since we're using it just for seeding hashmap randomness (i.e., not for generating entropy in an ongoing fashion) it seems to fit the use case described in the API.

However, I'm relatively unfamiliar with this side of libstd, so another reviewer would be good. Perhaps @LukasKalbertodt? Not sure who we have who is familiar with this...

@LukasKalbertodt
Copy link
Member

I'm really sorry, but I don't think I can reasonably review this PR either (I've never worked with MacOS, for one). To avoid reassigning a bunch of times still:

@rust-lang/libs @RalfJung Can anyone of you review this PR? Thanks :)

@RalfJung
Copy link
Member

I have never used a macOS system, so... I don't think I can give good feedback here.^^ I agree with what @Mark-Simulacrum said.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good to me and matches what the popular getrandom crate has been using for the past 9 months.

@dtolnay
Copy link
Member

dtolnay commented Mar 21, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Mar 21, 2020

📌 Commit 61ef72f has been approved by dtolnay

@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 Mar 21, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 23, 2020
This was referenced Mar 23, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 23, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#69251 (#[track_caller] in traits)
 - rust-lang#69880 (miri engine: turn error sanity checks into assertions)
 - rust-lang#70207 (Use getentropy(2) on macos)
 - rust-lang#70227 (Only display definition when suggesting a typo)
 - rust-lang#70236 (resolve: Avoid "self-confirming" import resolutions in one more case)
 - rust-lang#70248 (parser: simplify & remove unused field)
 - rust-lang#70249 (handle ConstKind::Unresolved after monomorphizing)
 - rust-lang#70269 (remove redundant closures (clippy::redundant_closure))
 - rust-lang#70270 (Clean up E0449 explanation)

Failed merges:

r? @ghost
@bors bors merged commit 675bdf6 into rust-lang:master Mar 23, 2020
@dtolnay dtolnay assigned dtolnay and unassigned LukasKalbertodt Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On macOS, try getentropy() before opening /dev/urandom?
7 participants