2012-04-05 16:52:04 -05:00
|
|
|
#ifndef UTIL_LINUX_RANDUTILS
|
|
|
|
#define UTIL_LINUX_RANDUTILS
|
|
|
|
|
|
|
|
#ifdef HAVE_SRANDOM
|
|
|
|
#define srand(x) srandom(x)
|
|
|
|
#define rand() random()
|
|
|
|
#endif
|
|
|
|
|
2016-09-06 03:19:52 -05:00
|
|
|
/* rand() based */
|
|
|
|
extern int rand_get_number(int low_n, int high_n);
|
|
|
|
|
|
|
|
/* /dev/urandom based with fallback to rand() */
|
2012-04-05 16:52:04 -05:00
|
|
|
extern int random_get_fd(void);
|
2020-11-08 05:47:18 -06:00
|
|
|
extern int ul_random_get_bytes(void *buf, size_t nbytes);
|
2014-03-08 15:43:26 -06:00
|
|
|
extern const char *random_tell_source(void);
|
2012-04-05 16:52:04 -05:00
|
|
|
|
|
|
|
#endif
|