If you had a dumb tty port (or driver) and your write blocked until pre-emption
then we'd sleep expecting a tty wake event even though the tty doesn't provide
one.
Instead if we got told 'soon' we yield when asked to pre-empt.
udata.u_error = EAGAIN;
return 1;
}
- irq = di();
- tty_sleeping(minor);
- psleep(&ttydata[minor]);
- irqrestore(irq);
+ if (t != TTY_READY_SOON) {
+ irq = di();
+ tty_sleeping(minor);
+ psleep(&ttydata[minor]);
+ irqrestore(irq);
+ } else
+ /* Yield */
+ switchout();
}
}
}