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
/openat
with/dev/random
and/dev/urandom
- Calling
read
andclose
on 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.