]> git.ipfire.org Git - thirdparty/gcc.git/commit - libgfortran/ChangeLog
Use getentropy() for seeding PRNG
authorJanne Blomqvist <jb@gcc.gnu.org>
Mon, 13 Aug 2018 20:21:50 +0000 (23:21 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Mon, 13 Aug 2018 20:21:50 +0000 (23:21 +0300)
commitd66d6d15f1ab42c503025548d6ab9772a85ad791
tree0cb0150a31538dfc107e19dbeff59fef4420ae6f
parent72217988ca377398e5c7c1ae98b83ca53b1877d4
Use getentropy() for seeding PRNG

The getentropy function, found on Linux, OpenBSD, and recently also
FreeBSD, can be used to get random bytes to initialize the PRNG.  It
is similar to the traditional way of reading from /dev/urandom, but
being a system call rather than a special file, it doesn't suffer from
problems like running out of file descriptors, or failure when running
in a container where /dev/urandom may not be available.

Regtested on x86_64-pc-linux-gnu, Ok for trunk?

2018-08-13  Janne Blomqvist  <jb@gcc.gnu.org>

* configure.ac: Check for getentropy.
* intrinsics/random.c (getosrandom): Use getentropy if available.
* config.h.in: Regenerated.
* configure: Regenerated.

From-SVN: r263522
libgfortran/ChangeLog
libgfortran/config.h.in
libgfortran/configure
libgfortran/configure.ac
libgfortran/intrinsics/random.c