39 #include "blocxx/BLOCXX_config.h"
47 #include <sys/types.h>
49 #ifdef BLOCXX_HAVE_UNISTD_H
53 #ifdef BLOCXX_HAVE_SYS_TIME_H
60 namespace BLOCXX_NAMESPACE
66 OnceFlag guard = BLOCXX_ONCE_INIT;
67 unsigned int seed = 0;
72 : m_lowVal(lowVal), m_highVal(highVal)
87 time_t timeval = ::time(NULL);
94 std::ifstream infile(
"/dev/urandom", std::ios::in);
97 infile.open(
"/dev/random", std::ios::in);
101 unsigned int dev_rand_input;
104 infile.read(reinterpret_cast<char*>(&dev_rand_input),
sizeof(dev_rand_input));
108 seed = dev_rand_input ^ (getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec;
110 #ifdef BLOCXX_HAVE_SRANDOM
133 #ifdef BLOCXX_HAVE_RANDOM