summaryrefslogtreecommitdiff
path: root/sys/arch/sh
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/sh
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/sh')
-rw-r--r--sys/arch/sh/sh/mem.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/sh/sh/mem.c b/sys/arch/sh/sh/mem.c
index 596864a52ca..a42e0cd3782 100644
--- a/sys/arch/sh/sh/mem.c
+++ b/sys/arch/sh/sh/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.9 2016/09/25 15:23:37 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.10 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.21 2006/07/23 22:06:07 ad Exp $ */
/*
@@ -83,6 +83,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/uio.h>
#include <sys/malloc.h>
#include <sys/proc.h>
@@ -221,6 +222,13 @@ 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);
}