about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-11-06 07:03:09 +0100
committerGitHub <noreply@github.com>2019-11-06 07:03:09 +0100
commit828a3eef6605e3ca91835890026382798b14ac6c (patch)
tree4880ee363b60d5b89d463f7d06719f6bcf6a336c /src/libstd/sys/unix/stack_overflow.rs
parent167b8fedd615becb4e614ae0635a0e488cce70c4 (diff)
parentb4f92eaea23bee1b8574128878f909b8534b0f3d (diff)
downloadrust-828a3eef6605e3ca91835890026382798b14ac6c.tar.gz
rust-828a3eef6605e3ca91835890026382798b14ac6c.zip
Rollup merge of #66092 - niacat:master, r=nagisa
Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.

This system call is present on all supported NetBSD versions and provides an endless stream of non-blocking random data from the kernel's ChaCha20-based CSPRNG. It doesn't require a file like `/dev/urandom` to be opened.

The system call is documented here (under kern.arandom):
https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7+NetBSD-7.0

And defined here:
https://nxr.netbsd.org/xref/src/sys/sys/sysctl.h#273

The semantics are the same as FreeBSD so reading 256 bytes per call is fine.

Similar change for getrandom crate: rust-random/getrandom#115
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions