summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKarel Zak2016-09-06 10:19:52 +0200
committerKarel Zak2016-09-06 10:19:52 +0200
commita55d646bd3986937cd3a8488b6abaf74b2b9e28a (patch)
tree1876ccdc638c24b8411b9825b8b844084b2a264d /include
parentsfdisk: add --no-tell-kernel (diff)
downloadkernel-qcow2-util-linux-a55d646bd3986937cd3a8488b6abaf74b2b9e28a.tar.gz
kernel-qcow2-util-linux-a55d646bd3986937cd3a8488b6abaf74b2b9e28a.tar.xz
kernel-qcow2-util-linux-a55d646bd3986937cd3a8488b6abaf74b2b9e28a.zip
lib/randutils: add xsrand() and rand_get_number()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/randutils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/randutils.h b/include/randutils.h
index 17e2a02fa..7094a4c74 100644
--- a/include/randutils.h
+++ b/include/randutils.h
@@ -6,6 +6,11 @@
#define rand() random()
#endif
+/* rand() based */
+extern void xsrand(void);
+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 random_get_bytes(void *buf, size_t nbytes);
extern const char *random_tell_source(void);