1tcflush(3C) Standard C Library Functions tcflush(3C)
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() discards 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 o If queue_selector is TCIFLUSH it flushes data received but
22 not read.
23
24 o If queue_selector is TCOFLUSH it flushes data written but
25 not transmitted.
26
27 o If queue_selector is TCIOFLUSH it flushes both data received
28 but not read and data written but not transmitted.
29
30
31 Attempts to use tcflush() from a process which is a member of a back‐
32 ground process group on a fildes associated with its controlling termi‐
33 nal, will cause the process group to be sent a SIGTTOU signal. If the
34 calling process is blocking or ignoring SIGTTOU signals, the process is
35 allowed to perform the operation, and no signal is sent.
36
38 Upon successful completion, 0 is returned. Otherwise, −1 is returned
39 and errno is set to indicate the error.
40
42 The tcflush() function will fail if:
43
44 EBADF The fildes argument is not a valid file descriptor.
45
46
47 EINVAL The queue_selector argument is not a supported value.
48
49
50 ENOTTY The file associated with fildes is not a terminal.
51
52
53
54 The tcflush() function may fail if:
55
56 EIO The process group of the writing process is orphaned, and the
57 writing process is not ignoring or blocking SIGTTOU.
58
59
61 See attributes(5) for descriptions of the following attributes:
62
63
64
65
66 ┌─────────────────────────────┬───────────────────────────────┐
67 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
68 ├─────────────────────────────┼───────────────────────────────┤
69 │Interface Stability │Standard │
70 ├─────────────────────────────┼───────────────────────────────┤
71 │MT-Level │MT-Safe, and Async-Signal-Safe │
72 └─────────────────────────────┴───────────────────────────────┘
73
75 tcdrain(3C), attributes(5), standards(5), termio(7I)
76
77
78
79SunOS 5.11 14 Aug 2002 tcflush(3C)