'\" t .\" Copyright 2006-2015, Michael Kerrisk .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .TH tcflush 3 2026-07-02 "Linux man-pages 6.19" .SH NAME tcflush \- discard pending data .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .B #include .P .BI "int tcflush(int " fd ", int " queue_selector ); .fi .SH DESCRIPTION .BR tcflush () discards data written to the object referred to by .I fd but not transmitted, or data received but not read, depending on the value of .IR queue_selector : .TP .B TCIFLUSH flushes data received but not read. .TP .B TCOFLUSH flushes data written but not transmitted. .TP .B TCIOFLUSH flushes both data received but not read, and data written but not transmitted. .SH RETURN VALUE .TP .B 0 on success. .TP .B \-1 on failure and set .I errno to indicate the error. .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). .TS allbox; lbx lb lb l l l. Interface Attribute Value T{ .na .nh .BR tcflush () T} Thread safety MT-Safe .TE .SH STANDARDS POSIX.1-2008. .SH HISTORY POSIX.1-2001. .SH SEE ALSO .BR tcsendbreak (3), .BR tcdrain (3), .BR tcflow (3), .BR termios (7)