about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2018-08-26 21:13:44 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2018-08-26 21:22:54 +0200
commit09a615c09761d5066b19d4b58a6a1d0e515ede45 (patch)
treef8153ed4abd6ee15c1f314d38d0460572ca69619 /src/test/incremental/thinlto
parentcaed80ba4ba8d9f4d3fa8aa9af6c4092d779cd9d (diff)
downloadrust-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