summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2017-12-14 03:30:44 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2017-12-14 03:30:44 +0000
commit241c782d1f6fe6daac77fc94b6bf3a67ea40c065 (patch)
tree02518c59da07bf66f03104c89e548f50f3fbf011 /sys/arch/mips64
parentaa834dff21eb818f4e6766d6644f265d2fbbcf6b (diff)
fcntl(F_SETFL) invokes the FIONBIO and FIOASYNC ioctls internally, so
the memory devices (/dev/null, /dev/zero, etc) need to permit them. problem noted, tweak, and testing by jeremy@ ok deraadt@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/mem.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c
index 28706b9ba6d..619a1dc1467 100644
--- a/sys/arch/mips64/mips64/mem.c
+++ b/sys/arch/mips64/mips64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.22 2016/09/25 15:23:37 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.23 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -48,6 +48,7 @@
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/proc.h>
#include <sys/msgbuf.h>
#include <sys/systm.h>
@@ -196,5 +197,12 @@ mmmmap(dev_t dev, off_t off, int prot)
int
mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
+ switch (cmd) {
+ case FIONBIO:
+ case FIOASYNC:
+ /* handled by fd layer */
+ return 0;
+ }
+
return (EOPNOTSUPP);
}