diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2018-08-26 21:13:44 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2018-08-26 21:22:54 +0200 |
| commit | 09a615c09761d5066b19d4b58a6a1d0e515ede45 (patch) | |
| tree | f8153ed4abd6ee15c1f314d38d0460572ca69619 /src/test/incremental/thinlto | |
| parent | caed80ba4ba8d9f4d3fa8aa9af6c4092d779cd9d (diff) | |
| download | rust-09a615c09761d5066b19d4b58a6a1d0e515ede45.tar.gz rust-09a615c09761d5066b19d4b58a6a1d0e515ede45.zip | |
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.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
