]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use getentropy() for seeding PRNG
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Aug 2018 20:21:50 +0000 (20:21 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Aug 2018 20:21:50 +0000 (20:21 +0000)
commit75535607e52c1c115cf8a3b24b21d717b39c8f22
tree0cb0150a31538dfc107e19dbeff59fef4420ae6f
parentfdecd40d14877c6698d96747c2a06f58c8364f07
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263522 138bc75d-0d04-0410-961f-82ee72b054a4
libgfortran/ChangeLog
libgfortran/config.h.in
libgfortran/configure
libgfortran/configure.ac
libgfortran/intrinsics/random.c