read rng seed from random number source device
Linux and BSD system have random number source devices that can be used as source for a unguessable seed source. Other platforms fall back to generate the seed with gettime().
This commit is contained in:
@@ -925,7 +925,8 @@ E char *FDECL(strstri, (const char *, const char *));
|
||||
#endif
|
||||
E boolean
|
||||
FDECL(fuzzymatch, (const char *, const char *, const char *, BOOLEAN_P));
|
||||
E void NDECL(setrandom);
|
||||
E void NDECL(init_random);
|
||||
E void NDECL(reseed_random);
|
||||
E time_t NDECL(getnow);
|
||||
E int NDECL(getyear);
|
||||
#if 0
|
||||
|
||||
@@ -408,5 +408,18 @@
|
||||
# define RUNTIME_PASTEBUF_SUPPORT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* /dev/random is blocking on Linux, so there we default to /dev/urandom which
|
||||
* should still be good enough.
|
||||
* BSD systems usually have /dev/random that is supposed to be used.
|
||||
*/
|
||||
#ifdef LINUX
|
||||
# define DEV_RANDOM "/dev/urandom"
|
||||
#else
|
||||
# ifdef BSD
|
||||
# define DEV_RANDOM "/dev/random"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* UNIXCONF_H */
|
||||
#endif /* UNIX */
|
||||
|
||||
Reference in New Issue
Block a user