-
Notifications
You must be signed in to change notification settings - Fork 410
Closed
rust-lang/rust
#60156Labels
A-macArea: Affects only macOS targetsArea: Affects only macOS targetsA-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement
Description
PR #683 implemented support for random number generation on Windows and (relatively recent) Linux. This was accomplished by implementing RtlGenRandom and getrandom for Windows and Linux respectively.
For OS X (and other Unix systems without getrandom), implementing random number generation is significantly more complicated. We need to implement the following:
- Calling
open/openatwith/dev/randomand/dev/urandom - Calling
readandcloseon the 'file descriptor' created above.
On Linux, file descriptors appear to be assigned sequentially. However, I don't believe that anything actually guarantees this - in other words, this could potentially be considered a source of non-determinism.
Metadata
Metadata
Assignees
Labels
A-macArea: Affects only macOS targetsArea: Affects only macOS targetsA-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement