diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:14:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:14:44 +0000 |
commit | 30ff6afe596eddafacf22b1a5b2d1a3d6254ea15 (patch) | |
tree | 9b788335f92174baf7ee18f03ca8330b8c19ce2b /include/randutils.h | |
parent | Initial commit. (diff) | |
download | util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.tar.xz util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.zip |
Adding upstream version 2.36.1.upstream/2.36.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | include/randutils.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/randutils.h b/include/randutils.h new file mode 100644 index 0000000..5b863d0 --- /dev/null +++ b/include/randutils.h @@ -0,0 +1,17 @@ +#ifndef UTIL_LINUX_RANDUTILS +#define UTIL_LINUX_RANDUTILS + +#ifdef HAVE_SRANDOM +#define srand(x) srandom(x) +#define rand() random() +#endif + +/* rand() based */ +extern int rand_get_number(int low_n, int high_n); + +/* /dev/urandom based with fallback to rand() */ +extern int random_get_fd(void); +extern void ul_random_get_bytes(void *buf, size_t nbytes); +extern const char *random_tell_source(void); + +#endif |