.TH "tcflush()" "" "" "termios Macro (termios.h)"
.PC "Flush data being exchanged with a terminal"
.B "#include <termios.h>"
\fBint tcflush (\fIfd\^\fB, \fIqueue_selector\^\fB)\fR
\fBint \fIfd\^\fB;\fR
\fBint \fIqueue_selector\^\fB;\fR
.PP
The
.B termios
macro
.B tcflush()
discards, or ``flushes,'' data send to or received from
the terminal device described by the file descriptor
.IR fd .
.I queue_selector
indicates what to do, as follows:
.IP \fBTCIFLUSH\fR
Flush data received but not read.
.IP \fBTCOFLUSH\fR
Flush data written but not transmitted.
.IP \fBTCIOFLUSH\fR
Flush both data written and data read.
.PP
These constants are defined in header file
.BR <termios.h> .
.PP
If all goes well,
.B tcflush()
returns zero.
If something goes wrong, it returns \-1 and sets
.B errno
to an appropriate value, as follows:
.IP \fBEBADF\fR
.I fd
is not a valid file descriptor.
.IP \fBEINVAL\fR
.I queue_selector
is not a proper value.
.IP \fBENOTTY\fR
.I fd
does not describe a terminal device.
.SH "See Also"
.Xr "termios" termios
.br
\*(PX Standard, \(sc7.2.2
