Function termios::tcflush[][src]

pub fn tcflush(fd: RawFd, queue_selector: c_int) -> Result<()>

Discards data waiting in the terminal device's buffers.

tcflush() discards data that has been written to the device by an application but has not yet been transmitted by the hardware or data that has been received by the hardware but has not yet been read by an application.

Parameters

  • fd should be an open file descriptor associated with a terminal.
  • queue_selector should be one of:
    • TCIFLUSH to discard data received but not read.
    • TCOFLUSH to discard data written but not transmitted.
    • TCIOFLUSH to discard both data received but not read and data written but not transmitted.