]>
Commit | Line | Data |
---|---|---|
faeb1b64 KZ |
1 | /* |
2 | * SPDX-License-Identifier: BSD-3-Clause | |
3 | */ | |
fe72459e DB |
4 | #ifndef UTIL_LINUX_RANDUTILS |
5 | #define UTIL_LINUX_RANDUTILS | |
6 | ||
7 | #ifdef HAVE_SRANDOM | |
8 | #define srand(x) srandom(x) | |
9 | #define rand() random() | |
10 | #endif | |
11 | ||
a55d646b | 12 | /* rand() based */ |
a55d646b KZ |
13 | extern int rand_get_number(int low_n, int high_n); |
14 | ||
15 | /* /dev/urandom based with fallback to rand() */ | |
fe72459e | 16 | extern int random_get_fd(void); |
e4be3ee0 | 17 | extern int ul_random_get_bytes(void *buf, size_t nbytes); |
0720d60c | 18 | extern const char *random_tell_source(void); |
fe72459e DB |
19 | |
20 | #endif |