-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-macosOperating system: macOSOperating system: macOST-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Background
Hi, I'm developing a HTTP load generator called oha. The application often exceeds the number of open file limit and then, tokio runtime crashes because it tries to open /dev/urandom
to generate random on macOS.
issue
On macOS, according to https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/rand.rs, fill_bytes
always read /dev/urandom
but opening /dev/urandom
may fail because of the limit of the number of open files.
So it would be better to try getentropy
like getrandom before reading /dev/urandom
.
Thanks.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-macosOperating system: macOSOperating system: macOST-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.