aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/configure
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2018-08-13 23:21:50 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2018-08-13 23:21:50 +0300
commitd66d6d15f1ab42c503025548d6ab9772a85ad791 (patch)
tree0cb0150a31538dfc107e19dbeff59fef4420ae6f /libgfortran/configure
parent72217988ca377398e5c7c1ae98b83ca53b1877d4 (diff)
downloadgcc-d66d6d15f1ab42c503025548d6ab9772a85ad791.zip
gcc-d66d6d15f1ab42c503025548d6ab9772a85ad791.tar.gz
gcc-d66d6d15f1ab42c503025548d6ab9772a85ad791.tar.bz2
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
Diffstat (limited to 'libgfortran/configure')
-rwxr-xr-xlibgfortran/configure7
1 files changed, 5 insertions, 2 deletions
diff --git a/libgfortran/configure b/libgfortran/configure
index 91fce8f..42b4c0b 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -2570,6 +2570,7 @@ as_fn_append ac_func_list " snprintf"
as_fn_append ac_func_list " ftruncate"
as_fn_append ac_func_list " chsize"
as_fn_append ac_func_list " chdir"
+as_fn_append ac_func_list " getentropy"
as_fn_append ac_func_list " getlogin"
as_fn_append ac_func_list " gethostname"
as_fn_append ac_func_list " kill"
@@ -12512,7 +12513,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12515 "configure"
+#line 12516 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12618,7 +12619,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12621 "configure"
+#line 12622 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16778,6 +16779,8 @@ done
+
+
fi
# Check strerror_r, cannot be above as versions with two and three arguments exist