--- old/usr/src/head/limits.h	2017-07-27 16:35:41.022666230 -0400
+++ new/usr/src/head/limits.h	2017-07-27 16:35:41.064114822 -0400
@@ -73,6 +73,11 @@
 #define	ARG_MAX		_ARG_MAX32	/* max length of arguments to exec */
 #endif	/* _LP64 */
 
+
+/*
+ * These two symbols have their historical values, the actual buffer is
+ * larger.
+ */
 #ifndef MAX_CANON
 #define	MAX_CANON	256	/* max bytes in line for canonical processing */
 #endif
--- old/usr/src/uts/common/io/ldterm.c	2017-07-27 16:35:42.112094446 -0400
+++ new/usr/src/uts/common/io/ldterm.c	2017-07-27 16:35:42.144085800 -0400
@@ -566,8 +566,8 @@
 	0x0bad,
 	"ldterm",
 	0,
-	256,
-	HIWAT,
+	_TTY_BUFSIZ,
+	_TTY_BUFSIZ,
 	LOWAT
 };
 
@@ -793,7 +793,7 @@
 	strop = (struct stroptions *)bp->b_wptr;
 	strop->so_flags = SO_READOPT|SO_HIWAT|SO_LOWAT|SO_NDELON|SO_ISTTY;
 	strop->so_readopt = RMSGN;
-	strop->so_hiwat = HIWAT;
+	strop->so_hiwat = _TTY_BUFSIZ;
 	strop->so_lowat = LOWAT;
 	bp->b_wptr += sizeof (struct stroptions);
 	bp->b_datap->db_type = M_SETOPTS;
@@ -1895,7 +1895,7 @@
 	 * Allows MAX_CANON bytes in the buffer before throwing awaying
 	 * the the overflow of characters.
 	 */
-	if ((tp->t_msglen > ((MAX_CANON + 1) - (int)tp->t_maxeuc)) &&
+	if ((tp->t_msglen > ((_TTY_BUFSIZ + 1) - (int)tp->t_maxeuc)) &&
 	    !((tp->t_state & TS_MEUC) && tp->t_eucleft)) {
 
 		/*
@@ -4383,8 +4383,8 @@
 			}
 			if ((tp->t_maxeuc > 1) || (tp->t_state & TS_MEUC)) {
 				if (!tp->t_eucp_mp) {
-					if (!(tp->t_eucp_mp = allocb(CANBSIZ,
-					    BPRI_HI))) {
+					if ((tp->t_eucp_mp = allocb(_TTY_BUFSIZ,
+					    BPRI_HI)) == NULL) {
 						tp->t_maxeuc = 1;
 						tp->t_state &= ~TS_MEUC;
 						cmn_err(CE_WARN,
@@ -4612,7 +4612,7 @@
 		tp->t_state &= ~TS_MEUC;
 		if (maxbytelen > 1 || maxscreenlen > 1) {
 			if (!tp->t_eucp_mp) {
-				if (!(tp->t_eucp_mp = allocb(CANBSIZ,
+				if (!(tp->t_eucp_mp = allocb(_TTY_BUFSIZ,
 				    BPRI_HI))) {
 					cmn_err(CE_WARN,
 					    "Can't allocate eucp_mp");
--- old/usr/src/uts/common/io/ptem.c	2017-07-27 16:35:43.944064249 -0400
+++ new/usr/src/uts/common/io/ptem.c	2017-07-27 16:35:43.974071416 -0400
@@ -28,8 +28,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI" /* from S5R4 1.13 */
-
 /*
  * Description:
  *
@@ -106,8 +104,8 @@
 	0xabcd,
 	"ptem",
 	0,
-	512,
-	512,
+	_TTY_BUFSIZ,
+	_TTY_BUFSIZ,
 	128
 };
 
@@ -201,7 +199,7 @@
 	mop->b_wptr += sizeof (struct stroptions);
 	sop = (struct stroptions *)mop->b_rptr;
 	sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
-	sop->so_hiwat = 512;
+	sop->so_hiwat = _TTY_BUFSIZ;
 	sop->so_lowat = 256;
 
 	/*
@@ -480,11 +478,12 @@
 
 		case M_FLUSH:
 			if (*mp->b_rptr & FLUSHW) {
-			    if ((ntp->state & IS_PTSTTY) &&
-					(*mp->b_rptr & FLUSHBAND))
-				flushband(q, *(mp->b_rptr + 1), FLUSHDATA);
-			    else
-				flushq(q, FLUSHDATA);
+				if ((ntp->state & IS_PTSTTY) &&
+				    (*mp->b_rptr & FLUSHBAND))
+					flushband(q, *(mp->b_rptr + 1),
+					    FLUSHDATA);
+				else
+					flushq(q, FLUSHDATA);
 			}
 			putnext(q, mp);
 			break;
@@ -1041,7 +1040,7 @@
 		mioc2ack(mp, NULL, 0, 0);
 		qreply(q, mp);
 		return;
-	    }
+	}
 
 	case TIOCREMOTE: {
 		int	onoff;
@@ -1082,7 +1081,7 @@
 		else
 			tp->state &= ~REMOTEMODE;
 		return;
-	    }
+	}
 
 	default:
 		putnext(q, mp);
--- old/usr/src/uts/common/io/ptm.c	2017-07-27 16:35:44.973631762 -0400
+++ new/usr/src/uts/common/io/ptm.c	2017-07-27 16:35:45.003921198 -0400
@@ -380,7 +380,7 @@
 		sop->so_flags = SO_HIWAT | SO_LOWAT;
 	else
 		sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
-	sop->so_hiwat = 512;
+	sop->so_hiwat = _TTY_BUFSIZ;
 	sop->so_lowat = 256;
 	putnext(rqp, mop);
 
--- old/usr/src/uts/common/io/pts.c	2017-07-27 16:35:45.973702389 -0400
+++ new/usr/src/uts/common/io/pts.c	2017-07-27 16:35:46.009868831 -0400
@@ -139,8 +139,8 @@
 	0xface,
 	"pts",
 	0,
-	512,
-	512,
+	_TTY_BUFSIZ,
+	_TTY_BUFSIZ,
 	128
 };
 
@@ -181,8 +181,8 @@
  * this will define (struct cb_ops cb_pts_ops) and (struct dev_ops pts_ops)
  */
 DDI_DEFINE_STREAM_OPS(pts_ops, nulldev, nulldev,	\
-	pts_attach, pts_detach, nodev,			\
-	pts_devinfo, PTS_CONF_FLAG, &ptsinfo, ddi_quiesce_not_supported);
+    pts_attach, pts_detach, nodev,			\
+    pts_devinfo, PTS_CONF_FLAG, &ptsinfo, ddi_quiesce_not_supported);
 
 /*
  * Module linkage information for the kernel.
@@ -409,7 +409,7 @@
 	mop->b_wptr += sizeof (struct stroptions);
 	sop = (struct stroptions *)mop->b_rptr;
 	sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
-	sop->so_hiwat = 512;
+	sop->so_hiwat = _TTY_BUFSIZ;
 	sop->so_lowat = 256;
 	putnext(rqp, mop);
 
--- old/usr/src/uts/common/io/zcons.c	2017-07-27 16:35:47.060400885 -0400
+++ new/usr/src/uts/common/io/zcons.c	2017-07-27 16:35:47.090542101 -0400
@@ -215,7 +215,7 @@
 	"zcons",
 	0,
 	INFPSZ,
-	2048,
+	_TTY_BUFSIZ,
 	128
 };
 
@@ -252,7 +252,7 @@
  * this will define (struct cb_ops cb_zc_ops) and (struct dev_ops zc_ops)
  */
 DDI_DEFINE_STREAM_OPS(zc_ops, nulldev, nulldev,	zc_attach, zc_detach, nodev, \
-	zc_getinfo, ZC_CONF_FLAG, &zc_tab_info, ddi_quiesce_not_needed);
+    zc_getinfo, ZC_CONF_FLAG, &zc_tab_info, ddi_quiesce_not_needed);
 
 /*
  * Module linkage information for the kernel.
@@ -501,7 +501,7 @@
 		sop->so_flags = SO_HIWAT | SO_LOWAT;
 	else
 		sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
-	sop->so_hiwat = 512;
+	sop->so_hiwat = _TTY_BUFSIZ;
 	sop->so_lowat = 256;
 	putnext(rqp, mop);
 
@@ -576,7 +576,7 @@
 	mop->b_wptr += sizeof (struct stroptions);
 	sop = (struct stroptions *)(void *)mop->b_rptr;
 	sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
-	sop->so_hiwat = 512;
+	sop->so_hiwat = _TTY_BUFSIZ;
 	sop->so_lowat = 256;
 	putnext(rqp, mop);
 
@@ -587,11 +587,11 @@
  * open(9e) entrypoint; checks sflag, and rejects anything unordinary.
  */
 static int
-zc_open(queue_t *rqp,		/* pointer to the read side queue */
-	dev_t   *devp,		/* pointer to stream tail's dev */
-	int	oflag,		/* the user open(2) supplied flags */
-	int	sflag,		/* open state flag */
-	cred_t  *credp)		/* credentials */
+zc_open(queue_t *rqp,	/* pointer to the read side queue */
+    dev_t   *devp,	/* pointer to stream tail's dev */
+    int	oflag,		/* the user open(2) supplied flags */
+    int	sflag,		/* open state flag */
+    cred_t  *credp)	/* credentials */
 {
 	int instance = ZC_INSTANCE(*devp);
 	int ret;
--- old/usr/src/uts/common/sys/param.h	2017-07-27 16:35:48.075471810 -0400
+++ new/usr/src/uts/common/sys/param.h	2017-07-27 16:35:48.105426995 -0400
@@ -71,13 +71,25 @@
 #endif
 #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
 
+/* The actual size of the TTY input queue */
+#define	_TTY_BUFSIZ	2048
+
+/*
+ * These defines all have their historical value.  The actual size of the tty
+ * buffer both for the line-editor in ldterm, and in general, is above as
+ * _TTY_BUFSIZ.
+ *
+ * We leave these defines at their historical value to match the behaviour of
+ * BSD and Linux.
+ */
 #ifndef	MAX_INPUT
 #define	MAX_INPUT	512	/* Maximum bytes stored in the input queue */
 #endif
-
 #ifndef	MAX_CANON
 #define	MAX_CANON	256	/* Maximum bytes for canonical processing */
 #endif
+#define	CANBSIZ		256	/* max size of typewriter line	*/
+
 
 #define	UID_NOBODY	60001	/* user ID no body */
 #define	GID_NOBODY	UID_NOBODY
@@ -117,8 +129,6 @@
 
 #define	NMOUNT		40	/* est. of # mountable fs for quota calc */
 
-#define	CANBSIZ		256	/* max size of typewriter line	*/
-
 #define	NOFILE		20	/* this define is here for	*/
 				/* compatibility purposes only	*/
 				/* and will be removed in a	*/
