summaryrefslogtreecommitdiffstats
path: root/include/randutils.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:30:35 +0000
commit378c18e5f024ac5a8aef4cb40d7c9aa9633d144c (patch)
tree44dfb6ca500d32cabd450649b322a42e70a30683 /include/randutils.h
parentInitial commit. (diff)
downloadutil-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.tar.xz
util-linux-378c18e5f024ac5a8aef4cb40d7c9aa9633d144c.zip
Adding upstream version 2.38.1.upstream/2.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/randutils.h')
-rw-r--r--include/randutils.h17
1 files changed, 17 insertions, 0 deletions
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