SCCS-vsn: sys/kern/tty.c 7.28
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)tty.c 7.27 (Berkeley) %G%
+ * @(#)tty.c 7.28 (Berkeley) %G%
(u.u_procp->p_flag&SVFORK) == 0 &&
(u.u_procp->p_sigignore & sigmask(SIGTTOU)) == 0 &&
(u.u_procp->p_sigmask & sigmask(SIGTTOU)) == 0) {
(u.u_procp->p_flag&SVFORK) == 0 &&
(u.u_procp->p_sigignore & sigmask(SIGTTOU)) == 0 &&
(u.u_procp->p_sigmask & sigmask(SIGTTOU)) == 0) {
- pgsignal(u.u_procp->p_pgrp, SIGTTOU);
+ pgsignal(u.u_procp->p_pgrp, SIGTTOU, 1);
if (error = tsleep((caddr_t)&lbolt, TTOPRI | PCATCH,
ttybg, 0))
return (error);
if (error = tsleep((caddr_t)&lbolt, TTOPRI | PCATCH,
ttybg, 0))
return (error);
}
tp->t_iflag = t->c_iflag;
tp->t_oflag = t->c_oflag;
}
tp->t_iflag = t->c_iflag;
tp->t_oflag = t->c_oflag;
+ /*
+ * Make the EXTPROC bit read only.
+ */
+ if (tp->t_lflag&EXTPROC)
+ t->c_lflag |= EXTPROC;
+ else
+ t->c_lflag &= ~EXTPROC;
tp->t_lflag = t->c_lflag;
bcopy(t->c_cc, tp->t_cc, sizeof(t->c_cc));
splx(s);
tp->t_lflag = t->c_lflag;
bcopy(t->c_cc, tp->t_cc, sizeof(t->c_cc));
splx(s);
if (bcmp((caddr_t)&tp->t_winsize, data,
sizeof (struct winsize))) {
tp->t_winsize = *(struct winsize *)data;
if (bcmp((caddr_t)&tp->t_winsize, data,
sizeof (struct winsize))) {
tp->t_winsize = *(struct winsize *)data;
- pgsignal(tp->t_pgrp, SIGWINCH);
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
*/
if ((tp->t_state&TS_TYPEN) == 0 && (iflag&ISTRIP))
c &= 0177;
*/
if ((tp->t_state&TS_TYPEN) == 0 && (iflag&ISTRIP))
c &= 0177;
+ if ((tp->t_lflag&EXTPROC) == 0) {
/*
* Check for literal nexting very first
*/
/*
* Check for literal nexting very first
*/
if ((lflag&NOFLSH) == 0)
ttyflush(tp, FREAD);
ttyecho(c, tp);
if ((lflag&NOFLSH) == 0)
ttyflush(tp, FREAD);
ttyecho(c, tp);
- pgsignal(tp->t_pgrp, SIGTSTP);
+ pgsignal(tp->t_pgrp, SIGTSTP, 1);
c = '\r';
else if (c == '\n' && iflag&INLCR)
c = '\r';
c = '\r';
else if (c == '\n' && iflag&INLCR)
c = '\r';
/*
* Non canonical mode, don't process line editing
* characters; check high water mark for wakeup.
/*
* Non canonical mode, don't process line editing
* characters; check high water mark for wakeup.
+ if ((tp->t_lflag&EXTPROC) == 0) {
/*
* From here on down canonical mode character
* processing takes place.
/*
* From here on down canonical mode character
* processing takes place.
goto endcase;
}
if (CCEQ(cc[VINFO], c)) {
goto endcase;
}
if (CCEQ(cc[VINFO], c)) {
- pgsignal(tp->t_pgrp, SIGINFO);
+ pgsignal(tp->t_pgrp, SIGINFO, 1);
if ((lflag&NOKERNINFO) == 0)
ttyinfo(tp);
goto endcase;
}
if ((lflag&NOKERNINFO) == 0)
ttyinfo(tp);
goto endcase;
}
/*
* Check for input buffer overflow
*/
/*
* Check for input buffer overflow
*/
c &= 0377;
/*
* Turn tabs to spaces as required
c &= 0377;
/*
* Turn tabs to spaces as required
+ *
+ * Special case if we have external processing, we don't
+ * do the tab expansion because we'll probably get it
+ * wrong. If tab expansion needs to be done, let it
+ * happen externally.
*/
if (c == '\t' && tp->t_oflag&OXTABS ) {
register int s;
*/
if (c == '\t' && tp->t_oflag&OXTABS ) {
register int s;
(u.u_procp->p_sigmask & sigmask(SIGTTIN)) ||
u.u_procp->p_flag&SVFORK || u.u_procp->p_pgrp->pg_jobc == 0)
return (EIO);
(u.u_procp->p_sigmask & sigmask(SIGTTIN)) ||
u.u_procp->p_flag&SVFORK || u.u_procp->p_pgrp->pg_jobc == 0)
return (EIO);
- pgsignal(u.u_procp->p_pgrp, SIGTTIN);
+ pgsignal(u.u_procp->p_pgrp, SIGTTIN, 1);
if (error = tsleep((caddr_t)&lbolt, TTIPRI | PCATCH, ttybg, 0))
return (error);
goto loop;
if (error = tsleep((caddr_t)&lbolt, TTIPRI | PCATCH, ttybg, 0))
return (error);
goto loop;
* delayed suspend (^Y)
*/
if (CCEQ(cc[VDSUSP], c) && lflag&ISIG) {
* delayed suspend (^Y)
*/
if (CCEQ(cc[VDSUSP], c) && lflag&ISIG) {
- pgsignal(tp->t_pgrp, SIGTSTP);
+ pgsignal(tp->t_pgrp, SIGTSTP, 1);
if (first) {
if (error = tsleep((caddr_t)&lbolt,
TTIPRI | PCATCH, ttybg, 0))
if (first) {
if (error = tsleep((caddr_t)&lbolt,
TTIPRI | PCATCH, ttybg, 0))
(u.u_procp->p_sigignore & sigmask(SIGTTOU)) == 0 &&
(u.u_procp->p_sigmask & sigmask(SIGTTOU)) == 0 &&
u.u_procp->p_pgrp->pg_jobc) {
(u.u_procp->p_sigignore & sigmask(SIGTTOU)) == 0 &&
(u.u_procp->p_sigmask & sigmask(SIGTTOU)) == 0 &&
u.u_procp->p_pgrp->pg_jobc) {
- pgsignal(u.u_procp->p_pgrp, SIGTTOU);
+ pgsignal(u.u_procp->p_pgrp, SIGTTOU, 1);
if (error = tsleep((caddr_t)&lbolt, TTIPRI | PCATCH, ttybg, 0))
goto out;
goto loop;
if (error = tsleep((caddr_t)&lbolt, TTIPRI | PCATCH, ttybg, 0))
goto out;
goto loop;
tp->t_rsel = 0;
}
if (tp->t_state & TS_ASYNC)
tp->t_rsel = 0;
}
if (tp->t_state & TS_ASYNC)
- pgsignal(tp->t_pgrp, SIGIO);
+ pgsignal(tp->t_pgrp, SIGIO, 1);
wakeup((caddr_t)&tp->t_rawq);
}
wakeup((caddr_t)&tp->t_rawq);
}