summaryrefslogtreecommitdiffstats
path: root/sys/sys/random.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2015-07-14 18:45:15 +0000
committered <ed@FreeBSD.org>2015-07-14 18:45:15 +0000
commit4f8313adcd77ccc0953275aa06bb5181e4f85954 (patch)
treee31443362ff95281e596323578398cada5e3d232 /sys/sys/random.h
parent0f95984131a638e861338eaae0614aa09b18e35d (diff)
downloadFreeBSD-src-4f8313adcd77ccc0953275aa06bb5181e4f85954.zip
FreeBSD-src-4f8313adcd77ccc0953275aa06bb5181e4f85954.tar.gz
Implement the CloudABI random_get() system call.
The random_get() system call works similar to getentropy()/getrandom() on OpenBSD/Linux. It fills a buffer with random data. This change introduces a new function, read_random_uio(), that is used to implement read() on the random devices. We can call into this function from within the CloudABI compatibility layer. Approved by: secteam Reviewed by: jmg, markm, wblock Obtained from: https://github.com/NuxiNL/freebsd Differential Revision: https://reviews.freebsd.org/D3053
Diffstat (limited to 'sys/sys/random.h')
-rw-r--r--sys/sys/random.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/random.h b/sys/sys/random.h
index 920d36b..78a9955 100644
--- a/sys/sys/random.h
+++ b/sys/sys/random.h
@@ -31,7 +31,12 @@
#ifdef _KERNEL
+#include <sys/types.h>
+
+struct uio;
+
u_int read_random(void *, u_int);
+int read_random_uio(struct uio *, bool);
/*
* Note: if you add or remove members of random_entropy_source, remember to also update the
OpenPOWER on IntegriCloud