1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "TCFLUSH" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
5 tcflush \- flush non-transmitted output data, non-read input data,
9 \fB#include <termios.h>
12 int tcflush(int\fP \fIfildes\fP\fB, int\fP \fIqueue_selector\fP\fB);
17 Upon successful completion, \fItcflush\fP() shall discard data written
18 to the object referred to by \fIfildes\fP (an open file
19 descriptor associated with a terminal) but not transmitted, or data
20 received but not read, depending on the value of
23 If \fIqueue_selector\fP is TCIFLUSH, it shall flush data received
27 If \fIqueue_selector\fP is TCOFLUSH, it shall flush data written but
31 If \fIqueue_selector\fP is TCIOFLUSH, it shall flush both data received
32 but not read and data written but not transmitted.
35 Attempts to use \fItcflush\fP() from a process which is a member of
36 a background process group on a \fIfildes\fP associated
37 with its controlling terminal shall cause the process group to be
38 sent a SIGTTOU signal. If the calling process is blocking or
39 ignoring SIGTTOU signals, the process shall be allowed to perform
40 the operation, and no signal is sent.
43 Upon successful completion, 0 shall be returned. Otherwise, -1 shall
44 be returned and \fIerrno\fP set to indicate the error.
47 The \fItcflush\fP() function shall fail if:
50 The \fIfildes\fP argument is not a valid file descriptor.
53 The \fIqueue_selector\fP argument is not a supported value.
56 The file associated with \fIfildes\fP is not a terminal.
59 The \fItcflush\fP() function may fail if:
62 The process group of the writing process is orphaned, and the writing
63 process is not ignoring or blocking SIGTTOU.
66 \fIThe following sections are informative.\fP
81 \fItcdrain\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
82 Chapter 11, General Terminal Interface, \fI<termios.h>\fP, \fI<unistd.h>\fP
84 Portions of this text are reprinted and reproduced in electronic form
85 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
86 -- Portable Operating System Interface (POSIX), The Open Group Base
87 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
88 Electrical and Electronics Engineers, Inc and The Open Group. In the
89 event of any discrepancy between this version and the original IEEE and
90 The Open Group Standard, the original IEEE and The Open Group Standard
91 is the referee document. The original Standard can be obtained online at
92 http://www.opengroup.org/unix/online.html .