aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/random')
-rw-r--r--sys/dev/random/randomdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c
index e27b90957d09..f3339aa40827 100644
--- a/sys/dev/random/randomdev.c
+++ b/sys/dev/random/randomdev.c
@@ -152,6 +152,13 @@ static struct selinfo rsel;
static int
randomdev_read(struct cdev *dev __unused, struct uio *uio, int flags)
{
+
+ return (read_random_uio(uio, (flags & O_NONBLOCK) != 0));
+}
+
+int
+read_random_uio(struct uio *uio, bool nonblock)
+{
uint8_t *random_buf;
int error;
ssize_t read_len, total_read, c;