void
seed_random()
{
-#if HASARC4RANDOM
- arc4random_stir();
-#else /* HASARC4RANDOM */
-# if HASSRANDOMDEV
+#if HASSRANDOMDEV
srandomdev();
-# else /* HASSRANDOMDEV */
+#else /* HASSRANDOMDEV */
long seed;
struct timeval t;
if (gettimeofday(&t, NULL) >= 0)
seed += t.tv_sec + t.tv_usec;
-# if HASRANDOM
+# if HASRANDOM
(void) srandom(seed);
-# else /* HASRANDOM */
+# else /* HASRANDOM */
(void) srand((unsigned int) seed);
-# endif /* HASRANDOM */
-# endif /* HASSRANDOMDEV */
-#endif /* HASARC4RANDOM */
+# endif /* HASRANDOM */
+#endif /* HASSRANDOMDEV */
}
\f/*
** SM_SYSLOG -- syslog wrapper to keep messages under SYSLOG_BUFSIZE
#if FAST_PID_RECYCLE
"FAST_PID_RECYCLE",
#endif /* FAST_PID_RECYCLE */
-#if HASARC4RANDOM
- "HASARC4RANDOM",
-#endif /* HASARC4RANDOM */
#if HASFCHOWN
"HASFCHOWN",
#endif /* HASFCHOWN */
# if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
# endif /* __FreeBSD_version >= 222000 */
-# if __FreeBSD_version >= 226000 /* 2.2.6-release and later */
-# define HASARC4RANDOM 1 /* has arc4random(3) function */
-# endif /* __FreeBSD_version >= 226000 */
# if __FreeBSD_version >= 330000 /* 3.3.0-release and later */
# ifndef HASSTRL
# define HASSTRL 1 /* has strlc{py,at}(3) functions */
# undef SPT_TYPE
# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
# define HASSETLOGIN 1 /* has setlogin(2) */
-# define HASARC4RANDOM 1 /* has arc4random(3) function */
+# define HASSRANDOMDEV 1 /* has srandomdev(3) */
# if OpenBSD < 199912
# define HASSTRL 0 /* strlcat(3) is broken in 2.5 and earlier */
# else /* OpenBSD < 199912 */
/* random routine -- set above using #ifdef _osname_ or in Makefile */
-#if HASARC4RANDOM
-# define get_random() (arc4random() & 0x7fffffff)
-#else
-# if HASRANDOM
-# define get_random() random()
-# else /* HASRANDOM */
-# define get_random() ((long) rand())
-# ifndef RANDOMSHIFT
-# define RANDOMSHIFT 8
-# endif /* RANDOMSHIFT */
-# endif /* HASRANDOM */
-#endif /* HASARC4RANDOM */
+#if HASRANDOM
+# define get_random() random()
+#else /* HASRANDOM */
+# define get_random() ((long) rand())
+# ifndef RANDOMSHIFT
+# define RANDOMSHIFT 8
+# endif /* RANDOMSHIFT */
+#endif /* HASRANDOM */
/*
** Default to using scanf in readcf.