Files
rust/src/libstd/sys
Tobias Bucher 09a615c097 Reduce number of syscalls in rand
In case that it is statically known that the OS doesn't support
`getrandom` (non-Linux) or becomes clear at runtime that `getrandom`
isn't available (`ENOSYS`), the opened fd ("/dev/urandom") isn't closed
after the function, so that future calls can reuse it. This saves
repeated `open`/`close` system calls at the cost of one permanently open
fd.

Additionally, this skips the initial zero-length `getrandom` call and
directly hands the user buffer to the operating system, saving one
`getrandom` syscall.
2018-08-26 21:22:54 +02:00
..
2018-08-26 21:22:54 +02:00
2018-07-28 17:58:52 +02:00
2018-06-25 20:38:29 +02:00