| 1567 | } |
| 1568 | |
| 1569 | int |
| 1570 | tty_timedwait(struct tty *tp, struct cv *cv, int hz) |
| 1571 | { |
| 1572 | int error; |
| 1573 | int revokecnt = tp->t_revokecnt; |
| 1574 | |
| 1575 | tty_lock_assert(tp, MA_OWNED|MA_NOTRECURSED); |
| 1576 | MPASS(!tty_gone(tp)); |
| 1577 | |
| 1578 | error = cv_timedwait_sig(cv, tp->t_mtx, hz); |
| 1579 | |
| 1580 | /* Bail out when the device slipped away. */ |
| 1581 | if (tty_gone(tp)) |
| 1582 | return (ENXIO); |
| 1583 | |
| 1584 | /* Restart the system call when we may have been revoked. */ |
| 1585 | if (tp->t_revokecnt != revokecnt) |
| 1586 | return (ERESTART); |
| 1587 | |
| 1588 | return (error); |
| 1589 | } |
| 1590 | |
| 1591 | void |
| 1592 | tty_flush(struct tty *tp, int flags) |
no test coverage detected