From 241c782d1f6fe6daac77fc94b6bf3a67ea40c065 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Thu, 14 Dec 2017 03:30:44 +0000 Subject: 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@ --- sys/arch/mips64/mips64/mem.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/arch/mips64') 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 #include #include +#include #include #include #include @@ -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); } -- cgit v1.2.3