summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/random.h
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2014-12-26 02:46:52 +0000
committerRobert Mustacchi <rm@joyent.com>2015-02-15 00:36:58 +0000
commitf31c6fa33bcc9a608ce6f9ffd671ffc2b65a30ef (patch)
tree804c1aad78118d760e083f79a0f411894272488f /usr/src/uts/common/sys/random.h
parentd34c3434a6ead24ec3e41daebf60ff85376c9e47 (diff)
downloadillumos-joyent-f31c6fa33bcc9a608ce6f9ffd671ffc2b65a30ef.tar.gz
OS-3845 want arc4random(3C) suite
OS-3846 want getentropy(3C) OS-3847 want getrandom(2) OS-3848 want explicit_bzero(3C) OS-3843 want MC_INHERIT_ZERO OS-3844 uuid_generate can leak its cache in edge conditions Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Diffstat (limited to 'usr/src/uts/common/sys/random.h')
-rw-r--r--usr/src/uts/common/sys/random.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/random.h b/usr/src/uts/common/sys/random.h
index a38201456f..b835d2f5ac 100644
--- a/usr/src/uts/common/sys/random.h
+++ b/usr/src/uts/common/sys/random.h
@@ -24,6 +24,7 @@
*/
/*
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc.
*/
#ifndef _SYS_RANDOM_H
@@ -61,10 +62,19 @@ typedef struct swrand_stats {
extern int random_add_entropy(uint8_t *, size_t, uint_t);
extern int random_get_bytes(uint8_t *, size_t);
+extern int random_get_blocking_bytes(uint8_t *, size_t);
extern int random_get_pseudo_bytes(uint8_t *, size_t);
#endif /* _KERNEL */
+/*
+ * Flags for the getrandom system call. Note, we may want to move these
+ * definitions if we expose getrandom(2) into a public system call.
+ */
+#define GRND_NONBLOCK 0x0001 /* O_NONBLOCK equiv */
+#define GRND_RANDOM 0x0002 /* Use /dev/random, not /dev/urandom */
+extern int getrandom(void *, size_t, int);
+
#ifdef __cplusplus
}
#endif