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
20

DESCRIPTION

22       Upon successful completion, tcflush() shall discard data written to the
23       object referred to by fildes (an open file descriptor associated with a
24       terminal) but not transmitted, or data received but not read, depending
25       on the value of queue_selector:
26
27        * If queue_selector is TCIFLUSH, it shall flush data received but  not
28          read.
29
30        * If  queue_selector  is TCOFLUSH, it shall flush data written but not
31          transmitted.
32
33        * If queue_selector is TCIOFLUSH, it shall flush  both  data  received
34          but not read and data written but not transmitted.
35
36       Attempts  to  use tcflush() from a process which is a member of a back‐
37       ground process group on a fildes associated with its controlling termi‐
38       nal  shall  cause the process group to be sent a SIGTTOU signal. If the
39       calling process is blocking or ignoring SIGTTOU  signals,  the  process
40       shall be allowed to perform the operation, 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       ENOTTY The file associated with fildes is not a terminal.
54
55
56       The tcflush() function may fail if:
57
58       EIO    The process group of the writing process is  orphaned,  and  the
59              writing process is not ignoring or blocking SIGTTOU.
60
61
62       The following sections are informative.
63

EXAMPLES

65       None.
66

APPLICATION USAGE

68       None.
69

RATIONALE

71       None.
72

FUTURE DIRECTIONS

74       None.
75

SEE ALSO

77       tcdrain(), the Base Definitions volume of IEEE Std 1003.1-2001, Chapter
78       11, General Terminal Interface, <termios.h>, <unistd.h>
79
81       Portions of this text are reprinted and reproduced in  electronic  form
82       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
83       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
84       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
85       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
86       event of any discrepancy between this version and the original IEEE and
87       The Open Group Standard, the original IEEE and The Open Group  Standard
88       is  the  referee document. The original Standard can be obtained online
89       at http://www.opengroup.org/unix/online.html .
90
91
92
93IEEE/The Open Group                  2003                          TCFLUSH(3P)
Impressum