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.
hatoo/oha#23
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.
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/urandomto generate random on macOS.hatoo/oha#23
issue
On macOS, according to https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/rand.rs,
fill_bytesalways read/dev/urandombut opening/dev/urandommay fail because of the limit of the number of open files.So it would be better to try
getentropylike getrandom before reading/dev/urandom.Thanks.