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 and close 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.
PR #683 implemented support for random number generation on Windows and (relatively recent) Linux. This was accomplished by implementing
RtlGenRandomandgetrandomfor 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:open/openatwith/dev/randomand/dev/urandomreadandcloseon 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.