~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "TCFLUSH" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" tcflush 
4
.SH NAME
5
tcflush \- flush non-transmitted output data, non-read input data,
6
or both
7
.SH SYNOPSIS
8
.LP
9
\fB#include <termios.h>
10
.br
11
.sp
12
int tcflush(int\fP \fIfildes\fP\fB, int\fP \fIqueue_selector\fP\fB);
13
.br
14
\fP
15
.SH DESCRIPTION
16
.LP
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
21
\fIqueue_selector\fP:
22
.IP " *" 3
23
If \fIqueue_selector\fP is TCIFLUSH, it shall flush data received
24
but not read.
25
.LP
26
.IP " *" 3
27
If \fIqueue_selector\fP is TCOFLUSH, it shall flush data written but
28
not transmitted.
29
.LP
30
.IP " *" 3
31
If \fIqueue_selector\fP is TCIOFLUSH, it shall flush both data received
32
but not read and data written but not transmitted.
33
.LP
34
.LP
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.
41
.SH RETURN VALUE
42
.LP
43
Upon successful completion, 0 shall be returned. Otherwise, -1 shall
44
be returned and \fIerrno\fP set to indicate the error.
45
.SH ERRORS
46
.LP
47
The \fItcflush\fP() function shall fail if:
48
.TP 7
49
.B EBADF
50
The \fIfildes\fP argument is not a valid file descriptor.
51
.TP 7
52
.B EINVAL
53
The \fIqueue_selector\fP argument is not a supported value.
54
.TP 7
55
.B ENOTTY
56
The file associated with \fIfildes\fP is not a terminal.
57
.sp
58
.LP
59
The \fItcflush\fP() function may fail if:
60
.TP 7
61
.B EIO
62
The process group of the writing process is orphaned, and the writing
63
process is not ignoring or blocking SIGTTOU.
64
.sp
65
.LP
66
\fIThe following sections are informative.\fP
67
.SH EXAMPLES
68
.LP
69
None.
70
.SH APPLICATION USAGE
71
.LP
72
None.
73
.SH RATIONALE
74
.LP
75
None.
76
.SH FUTURE DIRECTIONS
77
.LP
78
None.
79
.SH SEE ALSO
80
.LP
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
83
.SH COPYRIGHT
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 .