29#if defined(HAVE_SYS_RANDOM_H) && defined(HAVE_GETENTROPY)
30#include <sys/random.h>
37#ifdef FREECIV_MSWINDOWS
79#ifdef HAVE_BCRYPTGENRANDOM
100#if HAVE_USABLE_URANDOM
122 int n =
read(
fd, &seed,
sizeof(seed));
126 }
else if (
n !=
sizeof(seed)) {
150#if HAVE_CLOCK_GETTIME
198 log_debug(
"Got random seed from getentropy()");
202 log_debug(
"Got random seed from BCryptGenRandom()");
206 log_debug(
"Got random seed from urandom()");
211 log_normal(
_(
"No good random source usable. Falling back to time-based random seeding."));
214 log_debug(
"Got random seed with clock_gettime()");
220 log_warn(
_(
"Falling back to predictable random seed from current coarse-granularity time."));
222 log_debug(
"Got random seed from time()");
#define log_warn(message,...)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_error(message,...)
static bool generate_seed_getentropy(randseed *ret)
static bool generate_seed_clock_gettime(randseed *ret)
static bool generate_seed_bcryptgenrandom(randseed *ret)
randseed generate_game_seed(void)
static bool generate_seed_urandom(randseed *ret)
static bool generate_seed_time(randseed *ret)