From 30ff6afe596eddafacf22b1a5b2d1a3d6254ea15 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 15:14:44 +0200 Subject: Adding upstream version 2.36.1. Signed-off-by: Daniel Baumann --- include/randutils.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/randutils.h (limited to 'include/randutils.h') 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 -- cgit v1.2.3