summaryrefslogtreecommitdiff
path: root/sys/dev/random/randomdev.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2000-10-27 06:06:04 +0000
committerMark Murray <markm@FreeBSD.org>2000-10-27 06:06:04 +0000
commit5f3431b5ade253e5ea547b3bff5c61145da6c741 (patch)
tree4fa3dfc63e35a19a95246d99c23c0bb631793a77 /sys/dev/random/randomdev.c
parentcb16d62f47abc20e65f7241c6071cb56607fcc1f (diff)
Notes
Diffstat (limited to 'sys/dev/random/randomdev.c')
-rw-r--r--sys/dev/random/randomdev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c
index c8d2ebac1ee8..2f3e4a3f0e14 100644
--- a/sys/dev/random/randomdev.c
+++ b/sys/dev/random/randomdev.c
@@ -49,6 +49,8 @@
#include <dev/random/hash.h>
#include <dev/random/yarrow.h>
+#include "opt_noblockrandom.h"
+
static d_open_t random_open;
static d_read_t random_read;
static d_write_t random_write;
@@ -109,6 +111,8 @@ random_read(dev_t dev, struct uio *uio, int flag)
int error = 0;
void *random_buf;
+/* XXX Temporary ifndef to allow users to have a nonblocking device */
+#ifndef NOBLOCKRANDOM
while (!random_state.seeded) {
if (flag & IO_NDELAY)
error = EWOULDBLOCK;
@@ -117,6 +121,7 @@ random_read(dev_t dev, struct uio *uio, int flag)
if (error != 0)
return error;
}
+#endif
c = min(uio->uio_resid, PAGE_SIZE);
random_buf = (void *)malloc(c, M_TEMP, M_WAITOK);
while (uio->uio_resid > 0 && error == 0) {