Skip to content

Commit

Permalink
Add "standard" ioctl's so that userland programs (notably BIND9)
Browse files Browse the repository at this point in the history
get better blocking semantics. This update does virtually nothing
except for providing better returns to ioctl() calls.

OK'ed by:	jkh
  • Loading branch information
markm authored and markm committed Nov 17, 2000
1 parent 13de332 commit bfb126f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sys/i386/i386/mem.c
Expand Up @@ -50,6 +50,7 @@
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/filio.h>
#include <sys/ioccom.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
Expand Down Expand Up @@ -463,9 +464,10 @@ random_ioctl(dev, cmd, data, flags, p)
/*
* We're the random or urandom device. The only ioctls are for
* selecting and inspecting which interrupts are used in the muck
* gathering business.
* gathering business and the fcntl() stuff.
*/
if (cmd != MEM_SETIRQ && cmd != MEM_CLEARIRQ && cmd != MEM_RETURNIRQ)
if (cmd != MEM_SETIRQ && cmd != MEM_CLEARIRQ && cmd != MEM_RETURNIRQ
&& cmd != FIONBIO && cmd != FIOASYNC)
return (ENOTTY);

/*
Expand All @@ -488,6 +490,10 @@ random_ioctl(dev, cmd, data, flags, p)
interrupt_mask = 1 << intr;
sc = &random_softc[intr];
switch (cmd) {
/* Really handled in upper layer */
case FIOASYNC:
case FIONBIO:
break;
case MEM_SETIRQ:
if (interrupt_allowed & interrupt_mask)
break;
Expand Down

0 comments on commit bfb126f

Please sign in to comment.