MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / tty_flush

Function tty_flush

components/lwp/terminal/freebsd/tty.c:1067–1091  ·  view source on GitHub ↗

discard data in I/O buffers */

Source from the content-addressed store, hash-verified

1065
1066/* discard data in I/O buffers */
1067void 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
1093void tty_set_winsize(struct lwp_tty *tp, const struct winsize *wsz)
1094{

Callers 5

ttydisc_closeFunction · 0.85
ttydisc_modemFunction · 0.85
ttydisc_rintFunction · 0.85
ttydev_closeFunction · 0.85
tty_generic_ioctlFunction · 0.85

Calls 7

ttyoutq_flushFunction · 0.85
tty_wakeupFunction · 0.85
ttydevsw_outwakeupFunction · 0.85
ttydevsw_pktnotifyFunction · 0.85
tty_hiwat_in_unblockFunction · 0.85
ttyinq_flushFunction · 0.85
ttydevsw_inwakeupFunction · 0.85

Tested by

no test coverage detected