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

std::rand: adding solaris/illumos for getrandom support. #124766

Merged
merged 1 commit into from
May 11, 2024

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented May 5, 2024

@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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 O-unix Operating system: Unix-like 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 May 5, 2024
@RalfJung
Copy link
Member

RalfJung commented May 5, 2024

Cc @josephlr who just filed rust-random/getrandom#417

Copy link
Contributor

@josephlr josephlr left a comment

Choose a reason for hiding this comment

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

Line 62 also needs to be updated to include illumos/solaris so that there's a definition of getrandom.

Otherwise, the implementation looks good. For the uses in libstd (generating random hashmap seeds), using getrandom with flags = 0 is definitely the right call (on both illumos and Solaris). You also don't have to worry about maximum buffer size issues on Solaris as you will only be requesting 16 bytes at a time.

@RalfJung
Copy link
Member

RalfJung commented May 6, 2024

For the uses in libstd (generating random hashmap seeds), using getrandom with flags = 0 is definitely the right call (on both illumos and Solaris). You also don't have to worry about maximum buffer size issues on Solaris as you will only be requesting 16 bytes at a time.

Maybe there should be a comment explaining that. It seems confusing that this would use a different function than the getrandom crate.

@RalfJung
Copy link
Member

RalfJung commented May 6, 2024

This helps with rust-lang/miri#3567.

(@devnexen when you open a PR that is related to some issue, please mention the issue in the PR description. That helps give context to the reviewer, and to whoever is looking at the issue it helps determine the current status. Generally, PRs should almost always have a description that explains what is done and why.)

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 11, 2024

📌 Commit 1d45f47 has been approved by Mark-Simulacrum

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 May 11, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#124766 (std::rand: adding solaris/illumos for getrandom support.)
 - rust-lang#124818 (Update ena to 0.14.3)
 - rust-lang#124991 (Fix typo in ManuallyDrop's documentation)
 - rust-lang#124994 (Add `@saethlin` to some triagebot groups)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f73f266 into rust-lang:master May 11, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2024
Rollup merge of rust-lang#124766 - devnexen:getrandom_solarish, r=Mark-Simulacrum

std::rand: adding solaris/illumos for getrandom support.

To help solarish support for miri https://rust-lang/miri#3567
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.

6 participants