summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-06-08 01:58:56 +0200
committerTheodore Ts'o <tytso@mit.edu>2017-06-20 04:06:28 +0200
commite297a783e41560b44e3c14f38e420cba518113b8 (patch)
treea41cb88b534c7e50faa9ae889d825b5c6db8a9b7 /include
parentrandom: silence compiler warnings and fix race (diff)
downloadlinux-e297a783e41560b44e3c14f38e420cba518113b8.tar.xz
linux-e297a783e41560b44e3c14f38e420cba518113b8.zip
random: add wait_for_random_bytes() API
This enables users of get_random_{bytes,u32,u64,int,long} to wait until the pool is ready before using this function, in case they actually want to have reliable randomness. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/random.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index ed5c3838780d..e29929347c95 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -34,6 +34,7 @@ extern void add_input_randomness(unsigned int type, unsigned int code,
extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
extern void get_random_bytes(void *buf, int nbytes);
+extern int wait_for_random_bytes(void);
extern int add_random_ready_callback(struct random_ready_callback *rdy);
extern void del_random_ready_callback(struct random_ready_callback *rdy);
extern void get_random_bytes_arch(void *buf, int nbytes);