2023-01-12 15:33:09 +01:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
2012-04-05 23:52:04 +02:00
|
|
|
#ifndef UTIL_LINUX_RANDUTILS
|
|
|
|
#define UTIL_LINUX_RANDUTILS
|
|
|
|
|
|
|
|
#ifdef HAVE_SRANDOM
|
|
|
|
#define srand(x) srandom(x)
|
|
|
|
#define rand() random()
|
|
|
|
#endif
|
|
|
|
|
2016-09-06 10:19:52 +02:00
|
|
|
/* rand() based */
|
|
|
|
extern int rand_get_number(int low_n, int high_n);
|
|
|
|
|
|
|
|
/* /dev/urandom based with fallback to rand() */
|
2012-04-05 23:52:04 +02:00
|
|
|
extern int random_get_fd(void);
|
2020-11-08 11:47:18 +00: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 23:52:04 +02:00
|
|
|
|
|
|
|
#endif
|