summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/io/zfd.c15
-rw-r--r--usr/src/uts/common/sys/zfd.h5
2 files changed, 20 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/zfd.c b/usr/src/uts/common/io/zfd.c
index 0b52a9179d..3edaa62bbe 100644
--- a/usr/src/uts/common/io/zfd.c
+++ b/usr/src/uts/common/io/zfd.c
@@ -694,6 +694,21 @@ zfd_wput(queue_t *qp, mblk_t *mp)
M_HANGUP);
miocack(qp, mp, 0, 0);
return;
+ case ZFD_HAS_SLAVE:
+ /*
+ * The process that passed the ioctl must be running in
+ * the global zone.
+ */
+ if (crgetzoneid(iocbp->ioc_cr) != GLOBAL_ZONEID) {
+ miocack(qp, mp, 0, EINVAL);
+ return;
+ }
+ if ((zfds->zfd_state & ZFD_STATE_SOPEN) != 0) {
+ miocack(qp, mp, 0, 0);
+ } else {
+ miocack(qp, mp, 0, ENOTTY);
+ }
+ return;
default:
break;
}
diff --git a/usr/src/uts/common/sys/zfd.h b/usr/src/uts/common/sys/zfd.h
index 21c52460f2..acf9ce8d33 100644
--- a/usr/src/uts/common/sys/zfd.h
+++ b/usr/src/uts/common/sys/zfd.h
@@ -51,6 +51,11 @@ extern "C" {
*/
#define ZFD_EOF (ZFD_IOC | 1)
+/*
+ * This ioctl succeeds if the slave side is open.
+ */
+#define ZFD_HAS_SLAVE (ZFD_IOC | 2)
+
#ifdef __cplusplus
}
#endif