the memory devices (/dev/null, /dev/zero, etc) need to permit them.
problem noted, tweak, and testing by jeremy@
ok deraadt@
-/* $OpenBSD: mem.c,v 1.32 2016/09/27 05:01:29 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.33 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.26 2000/03/29 03:48:20 simonb Exp $ */
/*
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/uio.h>
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);
}
-/* $OpenBSD: mem.c,v 1.32 2017/10/14 04:44:43 jsg Exp $ */
+/* $OpenBSD: mem.c,v 1.33 2017/12/14 03:30:43 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/ioccom.h>
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;
+ }
+
#ifdef MTRR
switch (minor(dev)) {
case 0:
-/* $OpenBSD: mem.c,v 1.19 2016/09/25 15:23:37 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.20 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */
/*
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
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);
}
-/* $OpenBSD: mem.c,v 1.2 2017/01/23 12:29:50 kettenis Exp $ */
+/* $OpenBSD: mem.c,v 1.3 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */
/*
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
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);
}
-/* $OpenBSD: mem.c,v 1.3 2017/09/08 05:36:51 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.4 2017/12/14 03:30:43 guenther Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/uio.h>
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);
}
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.52 2017/04/20 14:13:00 visa Exp $ */
+/* $OpenBSD: mem.c,v 1.53 2017/12/14 03:30:43 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/ioccom.h>
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;
+ }
+
#ifdef MTRR
switch (minor(dev)) {
case 0:
-/* $OpenBSD: mem.c,v 1.5 2016/09/25 15:23:37 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.6 2017/12/14 03:30:43 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
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);
}
-/* $OpenBSD: mem.c,v 1.25 2017/09/08 05:36:52 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.26 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/ioccom.h>
#include <sys/uio.h>
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);
}
-/* $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 $ */
/*
#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>
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);
}
-/* $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 $ */
/*
#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>
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);
}
-/* $OpenBSD: mem.c,v 1.7 2017/09/08 05:36:52 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.8 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/ioccom.h>
#include <sys/uio.h>
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);
}
-/* $OpenBSD: mem.c,v 1.18 2016/09/25 15:23:37 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.19 2017/12/14 03:30:43 guenther Exp $ */
/* $NetBSD: mem.c,v 1.18 2001/04/24 04:31:12 thorpej Exp $ */
/*
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/filio.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
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);
}