From 378c18e5f024ac5a8aef4cb40d7c9aa9633d144c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:30:35 +0200 Subject: Adding upstream version 2.38.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..690bf5e --- /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 int ul_random_get_bytes(void *buf, size_t nbytes); +extern const char *random_tell_source(void); + +#endif -- cgit v1.2.3