--- old/usr/src/lib/brand/ipkg/zone/platform.xml	Sat Mar 11 21:24:08 2017
+++ new/usr/src/lib/brand/ipkg/zone/platform.xml	Sat Mar 11 21:24:08 2017
@@ -53,6 +53,7 @@
 	<device match="dtrace/*" />
 	<device match="dtrace/provider/*" />
 	<device match="fd" />
+	<device match="full" />
 	<device match="ipnet" />
 	<device match="kstat" />
 	<device match="lo0" />
--- old/usr/src/lib/brand/labeled/zone/platform.xml	Sat Mar 11 21:24:08 2017
+++ new/usr/src/lib/brand/labeled/zone/platform.xml	Sat Mar 11 21:24:08 2017
@@ -67,6 +67,7 @@
 	<device match="dtrace/*" />
 	<device match="dtrace/provider/*" />
 	<device match="fd" />
+	<device match="full" />
 	<device match="ipnet" />
 	<device match="kstat" />
 	<device match="lo0" />
--- old/usr/src/lib/brand/sn1/zone/platform.xml	Sat Mar 11 21:24:09 2017
+++ new/usr/src/lib/brand/sn1/zone/platform.xml	Sat Mar 11 21:24:09 2017
@@ -57,6 +57,7 @@
 	<device match="dtrace/*" />
 	<device match="dtrace/provider/*" />
 	<device match="fd" />
+	<device match="full" />
 	<device match="ipnet" />
 	<device match="kstat" />
 	<device match="lo0" />
--- old/usr/src/lib/brand/solaris10/zone/platform.xml	Sat Mar 11 21:24:09 2017
+++ new/usr/src/lib/brand/solaris10/zone/platform.xml	Sat Mar 11 21:24:09 2017
@@ -69,6 +69,7 @@
 	<device match="dtrace/*" />
 	<device match="dtrace/provider/*" />
 	<device match="fd" />
+	<device match="full" />
 	<device match="ipnet" />
 	<device match="kstat" />
 	<device match="lo0" />
--- old/usr/src/man/man7d/Makefile	Sat Mar 11 21:24:09 2017
+++ new/usr/src/man/man7d/Makefile	Sat Mar 11 21:24:09 2017
@@ -54,6 +54,7 @@
 		fctl.7d		\
 		fd.7d		\
 		fp.7d		\
+		full.7d		\
 		gld.7d		\
 		hci1394.7d	\
 		hermon.7d	\
--- /dev/null	Sat Mar 11 21:24:10 2017
+++ new/usr/src/man/man7d/full.7d	Sat Mar 11 21:24:10 2017
@@ -0,0 +1,46 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source.  A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\" Copyright 2017 James S Blachly, MD <james.blachly@gmail.com>
+.
+.Dd "Feb 7, 2017"
+.Dt FULL 7D
+.Os
+.Sh NAME
+.Nm full
+.Nd always-full device
+.Sh SYNOPSIS
+.Pa /dev/full
+.Sh DESCRIPTION
+The
+.Nm
+device is used to test program behavior in out-of-space conditions.
+.Lp
+Writes always yield the error
+.Er ENOSPC.
+.Lp
+Reads supply an endless stream of zeros, identical to
+.Xr zero 7D
+.Lp
+.Xr lseek 2
+will always return successfully.
+.Lp
+.Xr mmap 2
+is not implemented.
+.Sh FILES
+.
+.Bl -tag -width Pa
+.It Pa /dev/full
+.El
+.
+.Sh SEE ALSO
+.Xr mem 7D ,
+.Xr null 7D ,
+.Xr zero 7D
--- old/usr/src/pkg/manifests/system-kernel.man7d.inc	Sat Mar 11 21:24:10 2017
+++ new/usr/src/pkg/manifests/system-kernel.man7d.inc	Sat Mar 11 21:24:10 2017
@@ -18,6 +18,7 @@
 file path=usr/share/man/man7d/console.7d
 file path=usr/share/man/man7d/cpuid.7d
 file path=usr/share/man/man7d/devinfo.7d
+file path=usr/share/man/man7d/full.7d
 file path=usr/share/man/man7d/gld.7d
 file path=usr/share/man/man7d/ipnet.7d
 file path=usr/share/man/man7d/kmdb.7d
--- old/usr/src/pkg/manifests/system-kernel.mf	Sat Mar 11 21:24:10 2017
+++ new/usr/src/pkg/manifests/system-kernel.mf	Sat Mar 11 21:24:10 2017
@@ -24,6 +24,7 @@
 # Copyright 2013 Saso Kiselkov. All rights reserved.
 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
 # Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
+# Copyright 2017 James S Blachly, MD <james.blachly@gmail.com>
 #
 
 #
@@ -182,9 +183,9 @@
     alias=pci1022,1100 \
     alias=pci1022,1101 \
     alias=pci1022,1102
-driver name=mm perms="allkmem 0600 root sys" perms="kmem 0640 root sys" \
-    perms="mem 0640 root sys" perms="null 0666 root sys" \
-    perms="zero 0666 root sys" \
+driver name=mm perms="allkmem 0600 root sys" perms="full 0666 root sys" \
+    perms="kmem 0640 root sys" perms="mem 0640 root sys" \
+    perms="null 0666 root sys" perms="zero 0666 root sys" \
     policy="allkmem read_priv_set=all write_priv_set=all" \
     policy="kmem read_priv_set=none write_priv_set=all" \
     policy="mem read_priv_set=none write_priv_set=all"
--- old/usr/src/uts/common/io/mem.c	Sat Mar 11 21:24:11 2017
+++ new/usr/src/uts/common/io/mem.c	Sat Mar 11 21:24:11 2017
@@ -25,6 +25,7 @@
 
 /*
  * Copyright (c) 2015, Joyent, Inc.  All rights reserved.
+ * Copyright 2017 James S Blachly, MD <james.blachly@gmail.com>
  */
 
 /*
@@ -160,6 +161,7 @@
 		{ "allkmem",	M_ALLKMEM,	0,	"all",	"all",	0600 },
 		{ "null",	M_NULL,	PRIVONLY_DEV,	NULL,	NULL,	0666 },
 		{ "zero",	M_ZERO, PRIVONLY_DEV,	NULL,	NULL,	0666 },
+		{ "full",	M_FULL, PRIVONLY_DEV,	NULL,	NULL,	0666 },
 	};
 	kstat_t *ksp;
 
@@ -221,6 +223,7 @@
 	switch (getminor(*devp)) {
 	case M_NULL:
 	case M_ZERO:
+	case M_FULL:
 	case M_MEM:
 	case M_KMEM:
 	case M_ALLKMEM:
@@ -247,6 +250,7 @@
 	switch (getminor(dev)) {
 	case M_NULL:
 	case M_ZERO:
+	case M_FULL:
 	case M_MEM:
 	case M_KMEM:
 	case M_ALLKMEM:
@@ -438,6 +442,14 @@
 
 			break;
 
+		case M_FULL:
+			if (rw == UIO_WRITE) {
+				error = ENOSPC;
+				break;
+			}
+			/* else it's a read, fall through to zero case */
+			/*FALLTHROUGH*/
+
 		case M_ZERO:
 			if (rw == UIO_READ) {
 				label_t ljb;
@@ -827,6 +839,7 @@
 		/* no longer supported with KPR */
 		return (-1);
 
+	case M_FULL:
 	case M_ZERO:
 		/*
 		 * We shouldn't be mmap'ing to /dev/zero here as
--- old/usr/src/uts/common/sys/mem.h	Sat Mar 11 21:24:11 2017
+++ new/usr/src/uts/common/sys/mem.h	Sat Mar 11 21:24:11 2017
@@ -25,6 +25,7 @@
 
 /*
  * Copyright (c) 2015, Joyent, Inc.  All rights reserved.
+ * Copyright (c) 2017 James S Blachly, MD <james.blachly@gmail.com>
  */
 
 #ifndef _SYS_MEM_H
@@ -45,6 +46,7 @@
 #define	M_NULL		2	/* /dev/null - EOF & Rathole */
 #define	M_ALLKMEM	3	/* /dev/allkmem - virtual kernel memory & I/O */
 #define	M_ZERO		12	/* /dev/zero - source of private memory */
+#define	M_FULL		13	/* /dev/full - write always ret ENOSPC */
 
 /*
  * Private ioctl for libkvm: translate virtual address to physical address.
