| 1022 | } |
| 1023 | |
| 1024 | int tty_wait(struct lwp_tty *tp, struct rt_condvar *cv) |
| 1025 | { |
| 1026 | int error; |
| 1027 | int revokecnt = tp->t_revokecnt; |
| 1028 | |
| 1029 | tty_lock_assert(tp, MA_OWNED | MA_NOTRECURSED); |
| 1030 | MPASS(!tty_gone(tp)); |
| 1031 | |
| 1032 | error = cv_wait_sig(cv, tp->t_mtx); |
| 1033 | |
| 1034 | /* Bail out when the device slipped away. */ |
| 1035 | if (tty_gone(tp)) |
| 1036 | return -ENXIO; |
| 1037 | |
| 1038 | /* Restart the system call when we may have been revoked. */ |
| 1039 | if (tp->t_revokecnt != revokecnt) |
| 1040 | return -ERESTART; |
| 1041 | |
| 1042 | return error; |
| 1043 | } |
| 1044 | |
| 1045 | int tty_timedwait(struct lwp_tty *tp, struct rt_condvar *cv, rt_tick_t timeout) |
| 1046 | { |
no outgoing calls
no test coverage detected