AC_CHECK_HEADER(glob.h,,[AC_ERROR(glob.h not found ...)])
AC_CHECK_HEADERS([dirent.h fnmatch.h])
AC_CHECK_HEADERS([sys/resource.h sys/types.h sys/un.h])
+ AC_CHECK_HEADERS([sys/random.h])
AC_CHECK_HEADERS([sys/socket.h net/if.h sys/mman.h linux/if_arp.h], [], [],
[[#ifdef HAVE_SYS_SOCKET_H
AC_FUNC_REALLOC
AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul memchr memrchr clock_gettime])
+ AC_CHECK_DECL([getrandom],
+ AC_DEFINE([HAVE_GETRANDOM], [1], [Use getrandom]),
+ [], [
+ #include <sys/random.h>
+ ])
+
OCFLAGS=$CFLAGS
CFLAGS=""
AC_CHECK_FUNCS([strlcpy strlcat])
return value;
}
+#elif defined(HAVE_GETRANDOM)
+long int RandomGet(void)
+{
+ if (g_disable_randomness)
+ return 0;
+
+ long int value = 0;
+ int ret = getrandom(&value, sizeof(value), 0);
+ /* ret should be sizeof(value), but if it is > 0 and < sizeof(value)
+ * it's still better than nothing so we return what we have */
+ if (ret <= 0) {
+ return -1;
+ }
+ return value;
+}
#elif defined(HAVE_CLOCK_GETTIME)
long int RandomGet(void)
{