summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/random.h
diff options
context:
space:
mode:
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