There has been a lot of discussion around whether arc4random should be included. Given how many different impementations of it are in the wild, we can't guarantee a secure implementation on all platforms.
dnl
AC_CHECK_HEADERS([atomic.h])
-dnl
-dnl Check for arc4random on BSD systems
-dnl
-AC_CHECK_DECLS([arc4random_buf])
-
dnl
dnl Check for getrandom on newer Linux kernels
dnl
zend_throw_exception(zend_ce_exception, "Could not gather sufficient random data", 0);
return FAILURE;
}
-#elif HAVE_DECL_ARC4RANDOM_BUF
- arc4random_buf(bytes, size);
#elif HAVE_DECL_GETRANDOM
/* Linux getrandom(2) syscall */
size_t read_bytes = 0;