From 6458d733a983150ebfc10b03d7734c3b42c6e303 Mon Sep 17 00:00:00 2001 From: markm Date: Fri, 27 Oct 2000 06:06:04 +0000 Subject: As the blocking model has seems to be troublesome for many, disable it for now with an option. This option is already deprecated, and will be removed when the entropy-harvesting code is fast enough to warrant it. --- sys/dev/random/randomdev.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/dev/random') diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index c8d2eba..2f3e4a3 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -49,6 +49,8 @@ #include #include +#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) { -- cgit v1.1