| 1192 | } |
| 1193 | |
| 1194 | size_t |
| 1195 | ttydisc_getc(struct tty *tp, void *buf, size_t len) |
| 1196 | { |
| 1197 | |
| 1198 | tty_assert_locked(tp); |
| 1199 | |
| 1200 | if (tp->t_flags & TF_STOPPED) |
| 1201 | return (0); |
| 1202 | |
| 1203 | if (ttyhook_hashook(tp, getc_inject)) |
| 1204 | return ttyhook_getc_inject(tp, buf, len); |
| 1205 | |
| 1206 | len = ttyoutq_read(&tp->t_outq, buf, len); |
| 1207 | |
| 1208 | if (ttyhook_hashook(tp, getc_capture)) |
| 1209 | ttyhook_getc_capture(tp, buf, len); |
| 1210 | |
| 1211 | ttydisc_wakeup_watermark(tp); |
| 1212 | atomic_add_long(&tty_nout, len); |
| 1213 | |
| 1214 | return (len); |
| 1215 | } |
| 1216 | |
| 1217 | int |
| 1218 | ttydisc_getc_uio(struct tty *tp, struct uio *uio) |
no test coverage detected