1TCFLUSH(3P)                POSIX Programmer's Manual               TCFLUSH(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       tcflush — flush non-transmitted output data, non-read  input  data,  or
13       both
14

SYNOPSIS

16       #include <termios.h>
17
18       int tcflush(int fildes, int queue_selector);
19

DESCRIPTION

21       Upon successful completion, tcflush() shall discard data written to the
22       object referred to by fildes (an open file descriptor associated with a
23       terminal) but not transmitted, or data received but not read, depending
24       on the value of queue_selector:
25
26        *  If queue_selector is TCIFLUSH, it shall flush data received but not
27           read.
28
29        *  If  queue_selector is TCOFLUSH, it shall flush data written but not
30           transmitted.
31
32        *  If queue_selector is TCIOFLUSH, it shall flush both  data  received
33           but not read and data written but not transmitted.
34
35       Attempts  to  use tcflush() from a process which is a member of a back‐
36       ground process group on a fildes associated with its controlling termi‐
37       nal  shall cause the process group to be sent a SIGTTOU signal.  If the
38       calling thread is blocking SIGTTOU signals or the process  is  ignoring
39       SIGTTOU signals, the process shall be allowed to perform the operation,
40       and no signal is sent.
41

RETURN VALUE

43       Upon successful completion, 0 shall be returned. Otherwise, -1 shall be
44       returned and errno set to indicate the error.
45

ERRORS

47       The tcflush() function shall fail if:
48
49       EBADF  The fildes argument is not a valid file descriptor.
50
51       EINVAL The queue_selector argument is not a supported value.
52
53       EIO    The  process group of the writing process is orphaned, the call‐
54              ing thread is not blocking  SIGTTOU,  and  the  process  is  not
55              ignoring SIGTTOU.
56
57       ENOTTY The file associated with fildes is not a terminal.
58
59       The following sections are informative.
60

EXAMPLES

62       None.
63

APPLICATION USAGE

65       None.
66

RATIONALE

68       None.
69

FUTURE DIRECTIONS

71       None.
72

SEE ALSO

74       tcdrain()
75
76       The Base Definitions volume of POSIX.1‐2017, Chapter 11, General Termi‐
77       nal Interface, <termios.h>
78
80       Portions of this text are reprinted and reproduced in  electronic  form
81       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
82       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
83       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
84       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
85       event of any discrepancy between this version and the original IEEE and
86       The Open Group Standard, the original IEEE and The Open Group  Standard
87       is  the  referee document. The original Standard can be obtained online
88       at http://www.opengroup.org/unix/online.html .
89
90       Any typographical or formatting errors that appear  in  this  page  are
91       most likely to have been introduced during the conversion of the source
92       files to man page format. To report such errors,  see  https://www.ker
93       nel.org/doc/man-pages/reporting_bugs.html .
94
95
96
97IEEE/The Open Group                  2017                          TCFLUSH(3P)
Impressum