There is no need for the configure script to check whether
__NR_getrandom is defined, as the source code can just use #ifdef.
[],
[#include <sys/stat.h>])
-# Check for possible support for the Linux getrandom() system call
-AC_CHECK_DECL([__NR_getrandom],
- [AC_DEFINE([HAVE_NR_GETRANDOM], [1], [Define to 1 if the system
- headers define a system call number for getrandom()])],
- [],
- [#include <sys/syscall.h>])
-
###############################################################################
# Required libraries #
###############################################################################
{
if (n == 0)
return;
-#ifdef HAVE_NR_GETRANDOM
+#ifdef __NR_getrandom
static bool getrandom_unavailable;
if (getrandom_unavailable)
try_dev_urandom:
;
-#endif /* HAVE_NR_GETRANDOM */
+#endif /* __NR_getrandom */
int fd = open("/dev/urandom", O_RDONLY);
if (fd < 0) {
ERROR_WITH_ERRNO("Unable to open /dev/urandom");