1TCFLUSH(P) POSIX Programmer's Manual TCFLUSH(P)
2
3
4
6 tcflush - flush non-transmitted output data, non-read input data, or
7 both
8
10 #include <termios.h>
11
12 int tcflush(int fildes, int queue_selector);
13
14
16 Upon successful completion, tcflush() shall discard data written to the
17 object referred to by fildes (an open file descriptor associated with a
18 terminal) but not transmitted, or data received but not read, depending
19 on the value of queue_selector:
20
21 * If queue_selector is TCIFLUSH, it shall flush data received but not
22 read.
23
24 * If queue_selector is TCOFLUSH, it shall flush data written but not
25 transmitted.
26
27 * If queue_selector is TCIOFLUSH, it shall flush both data received
28 but not read and data written but not transmitted.
29
30 Attempts to use tcflush() from a process which is a member of a back‐
31 ground process group on a fildes associated with its controlling termi‐
32 nal shall cause the process group to be sent a SIGTTOU signal. If the
33 calling process is blocking or ignoring SIGTTOU signals, the process
34 shall be allowed to perform the operation, and no signal is sent.
35
37 Upon successful completion, 0 shall be returned. Otherwise, -1 shall be
38 returned and errno set to indicate the error.
39
41 The tcflush() function shall fail if:
42
43 EBADF The fildes argument is not a valid file descriptor.
44
45 EINVAL The queue_selector argument is not a supported value.
46
47 ENOTTY The file associated with fildes is not a terminal.
48
49
50 The tcflush() function may fail if:
51
52 EIO The process group of the writing process is orphaned, and the
53 writing process is not ignoring or blocking SIGTTOU.
54
55
56 The following sections are informative.
57
59 None.
60
62 None.
63
65 None.
66
68 None.
69
71 tcdrain() , the Base Definitions volume of IEEE Std 1003.1-2001, Chap‐
72 ter 11, General Terminal Interface, <termios.h>, <unistd.h>
73
75 Portions of this text are reprinted and reproduced in electronic form
76 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
77 -- Portable Operating System Interface (POSIX), The Open Group Base
78 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
79 Electrical and Electronics Engineers, Inc and The Open Group. In the
80 event of any discrepancy between this version and the original IEEE and
81 The Open Group Standard, the original IEEE and The Open Group Standard
82 is the referee document. The original Standard can be obtained online
83 at http://www.opengroup.org/unix/online.html .
84
85
86
87IEEE/The Open Group 2003 TCFLUSH(P)