From 86f55b0420f864b518475f781ce7a3c619180b12 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 3 Sep 2019 00:34:35 +0300 Subject: arc4random: replace sysctl() with getrandom (on linux) Since sysctl() is deprecated for a long-long time, according to sysctl(2): Since Linux 2.6.24, uses of this system call result in warnings in the kernel log. Fixes: #890 Suggested-by: Pierce Lopez --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8dd1aaa5..b584341c 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,7 @@ AC_CHECK_HEADERS([ \ sys/timerfd.h \ sys/uio.h \ sys/wait.h \ + sys/random.h \ errno.h \ ]) @@ -256,6 +257,7 @@ AC_CHECK_HEADERS(sys/sysctl.h, [], [], [ #include #endif ]) + if test "x$ac_cv_header_sys_queue_h" = "xyes"; then AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h) AC_EGREP_CPP(yes, @@ -328,7 +330,7 @@ if test "x$ac_cv_header_sys_time_h" = "xyes"; then fi if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then - AC_CHECK_DECLS([CTL_KERN, KERN_RANDOM, RANDOM_UUID, KERN_ARND], [], [], + AC_CHECK_DECLS([CTL_KERN, KERN_ARND], [], [], [[#include #include ]] ) @@ -390,6 +392,7 @@ AC_CHECK_FUNCS([ \ usleep \ vasprintf \ getservbyname \ + getrandom \ ]) AM_CONDITIONAL(STRLCPY_IMPL, [test x"$ac_cv_func_strlcpy" = xno]) -- cgit v1.2.1