]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * SPDX-License-Identifier: BSD-3-Clause | |
3 | */ | |
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 | ||
12 | /* rand() based */ | |
13 | extern int rand_get_number(int low_n, int high_n); | |
14 | ||
15 | /* /dev/urandom based with fallback to rand() */ | |
16 | extern int random_get_fd(void); | |
17 | extern int ul_random_get_bytes(void *buf, size_t nbytes); | |
18 | extern const char *random_tell_source(void); | |
19 | ||
20 | #endif |