discard data in I/O buffers */
| 1065 | |
| 1066 | /* discard data in I/O buffers */ |
| 1067 | void tty_flush(struct lwp_tty *tp, int flags) |
| 1068 | { |
| 1069 | if (flags & FWRITE) |
| 1070 | { |
| 1071 | tp->t_flags &= ~TF_HIWAT_OUT; |
| 1072 | ttyoutq_flush(&tp->t_outq); |
| 1073 | tty_wakeup(tp, FWRITE); |
| 1074 | if (!tty_gone(tp)) |
| 1075 | { |
| 1076 | ttydevsw_outwakeup(tp); |
| 1077 | ttydevsw_pktnotify(tp, TIOCPKT_FLUSHWRITE); |
| 1078 | } |
| 1079 | } |
| 1080 | if (flags & FREAD) |
| 1081 | { |
| 1082 | tty_hiwat_in_unblock(tp); |
| 1083 | ttyinq_flush(&tp->t_inq); |
| 1084 | tty_wakeup(tp, FREAD); |
| 1085 | if (!tty_gone(tp)) |
| 1086 | { |
| 1087 | ttydevsw_inwakeup(tp); |
| 1088 | ttydevsw_pktnotify(tp, TIOCPKT_FLUSHREAD); |
| 1089 | } |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | void tty_set_winsize(struct lwp_tty *tp, const struct winsize *wsz) |
| 1094 | { |
no test coverage detected