+ if (tp->t_rawq.c_cc == 0) {
+ if (tp->t_state & TS_NBIO) {
+ u.u_error = EWOULDBLOCK;
+ return;
+ }
+ sleep((caddr_t)&tp->t_rawq, TTIPRI);
+ goto again;
+ }
+ while (tp->t_rawq.c_cc > 1 && uio->uio_resid > 0)
+ if (ureadc(getc(&tp->t_rawq), uio) < 0) {
+ u.u_error = EFAULT;
+ break;
+ }
+ if (tp->t_rawq.c_cc == 1)
+ (void) getc(&tp->t_rawq);
+ if (tp->t_rawq.c_cc)
+ return;
+ } else
+ if (tp->t_oproc)
+ (*linesw[tp->t_line].l_read)(tp, uio);
+ wakeup((caddr_t)&tp->t_rawq.c_cf);
+ if (pti->pt_selw) {
+ selwakeup(pti->pt_selw, pti->pt_flags & PF_WCOLL);
+ pti->pt_selw = 0;
+ pti->pt_flags &= ~PF_WCOLL;