projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
UPAGES 8; dumpstack 96; msgbufmap; kernacc rounding bug fixed
[unix-history]
/
usr
/
src
/
sys
/
kern
/
tty.c
diff --git
a/usr/src/sys/kern/tty.c
b/usr/src/sys/kern/tty.c
index
d33a8e5
..
2d61be7
100644
(file)
--- a/
usr/src/sys/kern/tty.c
+++ b/
usr/src/sys/kern/tty.c
@@
-1,4
+1,4
@@
-/* tty.c
3.17
%G% */
+/* tty.c
4.3
%G% */
/*
* TTY subroutines common to more than one line discipline
/*
* TTY subroutines common to more than one line discipline
@@
-57,6
+57,11
@@
char maptab[] ={
'X','Y','Z',000,000,000,000,000,
};
'X','Y','Z',000,000,000,000,000,
};
+short tthiwat[16] =
+ { 100,100,100,100,100,100,100,200,200,400,400,400,650,650,650,650 };
+short ttlowat[16] =
+ { 30, 30, 30, 30, 30, 30, 30, 50, 50,120,120,120,125,125,125,125 };
+
#define OBUFSIZ 100
/*
#define OBUFSIZ 100
/*
@@
-81,9
+86,6
@@
register struct tty *tp;
tlun.t_flushc = CTRL(o);
tlun.t_werasc = CTRL(w);
tlun.t_lnextc = CTRL(v);
tlun.t_flushc = CTRL(o);
tlun.t_werasc = CTRL(w);
tlun.t_lnextc = CTRL(v);
- tlun.t_lintr = CTRL(c);
- tlun.t_lerase = CTRL(h);
- tlun.t_lkill = CTRL(u);
tp->t_local = 0;
tp->t_lstate = 0;
/* end local */
tp->t_local = 0;
tp->t_lstate = 0;
/* end local */
@@
-195,10
+197,12
@@
register struct tty *tp;
/*
* Common code for tty ioctls.
*/
/*
* Common code for tty ioctls.
*/
-ttioctl(com, tp, addr, dev, flag)
+/*ARGSUSED*/
+ttioctl(tp, com, addr, flag)
register struct tty *tp;
caddr_t addr;
{
register struct tty *tp;
caddr_t addr;
{
+ int dev;
unsigned t;
struct sgttyb iocb;
struct clist tq;
unsigned t;
struct sgttyb iocb;
struct clist tq;
@@
-206,6
+210,16
@@
caddr_t addr;
register c;
int temp;
register c;
int temp;
+ /*
+ * This is especially so that isatty() will
+ * fail when carrier is gone.
+ */
+ if ((tp->t_state&CARR_ON) == 0) {
+ u.u_error = EBADF;
+ return (1);
+ }
+
+ dev = tp->t_dev;
/*
* If the ioctl involves modification,
* insist on being able to write the device,
/*
* If the ioctl involves modification,
* insist on being able to write the device,
@@
-213,7
+227,9
@@
caddr_t addr;
*/
switch(com) {
*/
switch(com) {
- case TIOCHPCL:
+ case TIOCSETD:
+ case TIOCSETP:
+ case TIOCSETN:
case TIOCFLUSH:
case TIOCSETC:
case TIOCSLTC:
case TIOCFLUSH:
case TIOCSETC:
case TIOCSLTC:
@@
-222,10
+238,12
@@
caddr_t addr;
case TIOCLBIC:
case TIOCLSET:
case TIOCSTI:
case TIOCLBIC:
case TIOCLSET:
case TIOCSTI:
+/* this is reasonable, but impractical...
if ((flag & FWRITE) == 0) {
u.u_error = EBADF;
return (1);
}
if ((flag & FWRITE) == 0) {
u.u_error = EBADF;
return (1);
}
+ */
while (tp->t_line == NTTYDISC &&
u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp &&
(u.u_procp->p_flag&SVFORK) == 0 &&
while (tp->t_line == NTTYDISC &&
u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp &&
(u.u_procp->p_flag&SVFORK) == 0 &&
@@
-300,6
+318,9
@@
caddr_t addr;
wflushtty(tp);
while (canon(tp)>=0)
;
wflushtty(tp);
while (canon(tp)>=0)
;
+#ifdef notdef
+ wakeup((caddr_t)&tp->t_rawq);
+#endif
} else if (tp->t_line == NTTYDISC) {
if (tp->t_flags&RAW || iocb.sg_flags&RAW ||
com == TIOCSETP)
} else if (tp->t_line == NTTYDISC) {
if (tp->t_flags&RAW || iocb.sg_flags&RAW ||
com == TIOCSETP)
@@
-314,9
+335,11
@@
caddr_t addr;
tp->t_local |= LPENDIN;
if (tp->t_canq.c_cc)
panic("ioccom canq");
tp->t_local |= LPENDIN;
if (tp->t_canq.c_cc)
panic("ioccom canq");
+#ifdef notdef
if (tp->t_chan)
(void) sdata(tp->t_chan);
else
if (tp->t_chan)
(void) sdata(tp->t_chan);
else
+#endif
wakeup((caddr_t)&tp->t_rawq);
}
}
wakeup((caddr_t)&tp->t_rawq);
}
}
@@
-355,15
+378,6
@@
caddr_t addr;
flushtty(tp, FREAD|FWRITE);
break;
flushtty(tp, FREAD|FWRITE);
break;
- /*
- * Ioctl entries to line discipline
- */
- case DIOCSETP:
- case DIOCGETP:
- if ((*linesw[tp->t_line].l_ioctl)(com, tp, addr))
- u.u_error = ENOTTY;
- break;
-
/*
* Set and fetch special characters
*/
/*
* Set and fetch special characters
*/