summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/head/limits.h5
-rw-r--r--usr/src/uts/common/io/ldterm.c14
-rw-r--r--usr/src/uts/common/io/ptem.c23
-rw-r--r--usr/src/uts/common/io/ptm.c2
-rw-r--r--usr/src/uts/common/io/pts.c10
-rw-r--r--usr/src/uts/common/io/zcons.c18
-rw-r--r--usr/src/uts/common/sys/param.h16
7 files changed, 51 insertions, 37 deletions
diff --git a/usr/src/head/limits.h b/usr/src/head/limits.h
index af5f03b9f4..eea3b0429e 100644
--- a/usr/src/head/limits.h
+++ b/usr/src/head/limits.h
@@ -73,6 +73,11 @@ extern "C" {
#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
diff --git a/usr/src/uts/common/io/ldterm.c b/usr/src/uts/common/io/ldterm.c
index f48b126ead..6c396db601 100644
--- a/usr/src/uts/common/io/ldterm.c
+++ b/usr/src/uts/common/io/ldterm.c
@@ -566,8 +566,8 @@ static struct module_info ldtermmiinfo = {
0x0bad,
"ldterm",
0,
- 256,
- HIWAT,
+ _TTY_BUFSIZ,
+ _TTY_BUFSIZ,
LOWAT
};
@@ -793,7 +793,7 @@ ldtermopen(queue_t *q, dev_t *devp, int oflag, int sflag, cred_t *crp)
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 @@ escaped:
* 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 @@ ldterm_do_ioctl(queue_t *q, mblk_t *mp)
}
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 @@ ldterm_do_ioctl(queue_t *q, mblk_t *mp)
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");
diff --git a/usr/src/uts/common/io/ptem.c b/usr/src/uts/common/io/ptem.c
index 3505e759e5..6b19cdde89 100644
--- a/usr/src/uts/common/io/ptem.c
+++ b/usr/src/uts/common/io/ptem.c
@@ -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 @@ static struct module_info ptem_info = {
0xabcd,
"ptem",
0,
- 512,
- 512,
+ _TTY_BUFSIZ,
+ _TTY_BUFSIZ,
128
};
@@ -201,7 +199,7 @@ ptemopen(
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 @@ ptemwput(queue_t *q, mblk_t *mp)
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 @@ ptioc(queue_t *q, mblk_t *mp, int qside)
mioc2ack(mp, NULL, 0, 0);
qreply(q, mp);
return;
- }
+ }
case TIOCREMOTE: {
int onoff;
@@ -1082,7 +1081,7 @@ ptioc(queue_t *q, mblk_t *mp, int qside)
else
tp->state &= ~REMOTEMODE;
return;
- }
+ }
default:
putnext(q, mp);
diff --git a/usr/src/uts/common/io/ptm.c b/usr/src/uts/common/io/ptm.c
index 400e9ffd10..d9ec6cc585 100644
--- a/usr/src/uts/common/io/ptm.c
+++ b/usr/src/uts/common/io/ptm.c
@@ -380,7 +380,7 @@ ptmopen(
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);
diff --git a/usr/src/uts/common/io/pts.c b/usr/src/uts/common/io/pts.c
index a53bbd9104..1bcdc2bcef 100644
--- a/usr/src/uts/common/io/pts.c
+++ b/usr/src/uts/common/io/pts.c
@@ -139,8 +139,8 @@ static struct module_info pts_info = {
0xface,
"pts",
0,
- 512,
- 512,
+ _TTY_BUFSIZ,
+ _TTY_BUFSIZ,
128
};
@@ -181,8 +181,8 @@ static int pts_detach(dev_info_t *, ddi_detach_cmd_t);
* 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 @@ ptsopen(
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);
diff --git a/usr/src/uts/common/io/zcons.c b/usr/src/uts/common/io/zcons.c
index 7a6b58fb75..d4169a6720 100644
--- a/usr/src/uts/common/io/zcons.c
+++ b/usr/src/uts/common/io/zcons.c
@@ -215,7 +215,7 @@ static struct module_info zc_info = {
"zcons",
0,
INFPSZ,
- 2048,
+ _TTY_BUFSIZ,
128
};
@@ -252,7 +252,7 @@ static struct streamtab zc_tab_info = {
* 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 @@ zc_master_open(zc_state_t *zcs,
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 @@ zc_slave_open(zc_state_t *zcs,
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 @@ zc_slave_open(zc_state_t *zcs,
* 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;
diff --git a/usr/src/uts/common/sys/param.h b/usr/src/uts/common/sys/param.h
index 4a04e83981..5c23c2fac3 100644
--- a/usr/src/uts/common/sys/param.h
+++ b/usr/src/uts/common/sys/param.h
@@ -71,13 +71,25 @@ extern "C" {
#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 @@ extern "C" {
#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 */