return 1;
return 0;
}
+
+void jobcontrol_in(struct tty *t)
+{
+ if (udata.u_proc->p_pgrp == t->pgrp)
+ return;
+ ssig(udata.u_proc, SIGTTIN);
+ /* So we halt */
+ pause(0);
+}
+
+void jobcontrol_out(struct tty *t)
+{
+ if (udata.u_proc->p_pgrp == t->pgrp)
+ return;
+ if (!(t->termios.t_lflag & TOSTOP))
+ return;
+ ssig(udata.u_proc, SIGTTOU);
+ /* So we halt */
+ pause(0);
+}
udata.u_error = ENXIO;
return -1;
}
+ jobcontrol_in(t);
if (remq(q, &c)) {
if (udata.u_sysio)
*udata.u_base = c;
break;
if (psleep_flags_io(&t->flag, flag, &written))
return written;
+ jobcontrol_out(t);
}
-
if (!(t->flag & TTYF_DISCARD)) {
if (udata.u_sysio)
c = *udata.u_base;
udata.u_error = ENXIO;
return -1;
}
+ jobcontrol_in(t);
switch (request) {
case TCGETS:
return uput(&t->termios, data, sizeof(struct termios));