summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/random_machdep.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-09-14 03:19:42 +0000
committerpeter <peter@FreeBSD.org>1997-09-14 03:19:42 +0000
commit796eb5ce0afbb92f7c829367cc09ec04472e0166 (patch)
tree0720cfdb6d407dea01c6b7bc049ac3afa3cc5020 /sys/i386/isa/random_machdep.c
parente762286917ce1de5d1fc3744a413be43a74c656b (diff)
downloadFreeBSD-src-796eb5ce0afbb92f7c829367cc09ec04472e0166.zip
FreeBSD-src-796eb5ce0afbb92f7c829367cc09ec04472e0166.tar.gz
Update select -> poll in drivers.
Diffstat (limited to 'sys/i386/isa/random_machdep.c')
-rw-r--r--sys/i386/isa/random_machdep.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/i386/isa/random_machdep.c b/sys/i386/isa/random_machdep.c
index affe38f..70d3c95 100644
--- a/sys/i386/isa/random_machdep.c
+++ b/sys/i386/isa/random_machdep.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.16 1997/04/26 11:46:03 peter Exp $
+ * $Id: random_machdep.c,v 1.17 1997/05/04 14:28:22 peter Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -45,6 +45,7 @@
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/select.h>
+#include <sys/poll.h>
#include <sys/fcntl.h>
#include <machine/clock.h>
@@ -494,22 +495,22 @@ write_random(const char *buf, u_int nbytes)
#endif /* notused */
int
-random_select(dev_t dev, int rw, struct proc *p)
+random_poll(dev_t dev, int events, struct proc *p)
{
- int s, ret;
-
- if (rw == FWRITE)
- return 1; /* heh. */
+ int s;
+ int revents = 0;
s = splhigh();
- if (random_state.entropy_count >= 8)
- ret = 1;
- else {
- selrecord(p, &random_state.rsel);
- ret = 0;
- }
+ if (events & (POLLIN | POLLRDNORM))
+ if (random_state.entropy_count >= 8)
+ revents |= events & (POLLIN | POLLRDNORM);
+ else
+ selrecord(p, &random_state.rsel);
+
splx(s);
+ if (events & (POLLOUT | POLLWRNORM))
+ revents |= events & (POLLOUT | POLLWRNORM); /* heh */
- return ret;
+ return (revents);
}
OpenPOWER on IntegriCloud