FreeBSD prior to 10.0 does not automatically stir on fork(). Same with
current NetBSD. If arc4random_stir() is present assume is needed and
call it instead of srand().
# Optional functions
AC_CHECK_FUNCS_ONCE([ \
# Optional functions
AC_CHECK_FUNCS_ONCE([ \
- arc4random gai_strerror getaddrinfo getnameinfo inet_aton sigaction \
- sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat strtok_r \
- waitpid])
+ arc4random arc4random_stir gai_strerror getaddrinfo getnameinfo inet_aton
+ sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \
+ strtok_r waitpid])
# -- Configuration options --
# -- Configuration options --
return -1;
case 0:
/* New child process: */
return -1;
case 0:
/* New child process: */
+#ifdef HAVE_ARC4RANDOM_STIR
+ arc4random_stir();
+#endif
#ifndef HAVE_ARC4RANDOM
srand(seed ^ (unsigned int)time(NULL) ^ getpid());
#endif
#ifndef HAVE_ARC4RANDOM
srand(seed ^ (unsigned int)time(NULL) ^ getpid());
#endif