8498 ficl: variable 'count' might be clobbered by 'longjmp' or 'vfork'
[unleashed.git] / share / man / man3c / tcflush.3c
blob417233832454b74ac75f830f2ac0b7d70f808626
1 '\" te
2 .\"  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved  Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH TCFLUSH 3C "Aug 14, 2002"
11 .SH NAME
12 tcflush \- flush non-transmitted output data, non-read input data or both
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <termios.h>
18 \fBint\fR \fBtcflush\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIqueue_selector\fR);
19 .fi
21 .SH DESCRIPTION
22 .sp
23 .LP
24 Upon successful completion, \fBtcflush()\fR discards data written to the object
25 referred to by \fIfildes\fR (an open file descriptor associated with a
26 terminal) but not transmitted, or data received but not read, depending on the
27 value of \fIqueue_selector\fR:
28 .RS +4
29 .TP
30 .ie t \(bu
31 .el o
32 If \fIqueue_selector\fR is \fBTCIFLUSH\fR it flushes data received but not
33 read.
34 .RE
35 .RS +4
36 .TP
37 .ie t \(bu
38 .el o
39 If \fIqueue_selector\fR is \fBTCOFLUSH\fR it flushes data written but not
40 transmitted.
41 .RE
42 .RS +4
43 .TP
44 .ie t \(bu
45 .el o
46 If \fIqueue_selector\fR is \fBTCIOFLUSH\fR it flushes both data received but
47 not read and data written but not transmitted.
48 .RE
49 .sp
50 .LP
51 Attempts to use \fBtcflush()\fR from a process which is a member of a
52 background process group on a \fIfildes\fR associated with its controlling
53 terminal, will cause the process group to be sent a \fBSIGTTOU\fR signal. If
54 the calling process is blocking or ignoring \fBSIGTTOU\fR signals, the process
55 is allowed to perform the operation, and no signal is sent.
56 .SH RETURN VALUES
57 .sp
58 .LP
59 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
60 returned and \fBerrno\fR is set to indicate the error.
61 .SH ERRORS
62 .sp
63 .LP
64 The \fBtcflush()\fR function will fail if:
65 .sp
66 .ne 2
67 .na
68 \fB\fBEBADF\fR\fR
69 .ad
70 .RS 10n
71 The \fIfildes\fR argument is not a valid file descriptor.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fBEINVAL\fR\fR
78 .ad
79 .RS 10n
80 The \fIqueue_selector\fR argument is not a supported value.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fBENOTTY\fR\fR
87 .ad
88 .RS 10n
89 The file associated with \fIfildes\fR is not a terminal.
90 .RE
92 .sp
93 .LP
94 The \fBtcflush()\fR function may fail if:
95 .sp
96 .ne 2
97 .na
98 \fB\fBEIO\fR\fR
99 .ad
100 .RS 7n
101 The process group of the writing process is orphaned, and the writing process
102 is not ignoring or blocking \fBSIGTTOU\fR.
105 .SH ATTRIBUTES
108 See \fBattributes\fR(5) for descriptions of the following attributes:
113 box;
114 c | c
115 l | l .
116 ATTRIBUTE TYPE  ATTRIBUTE VALUE
118 Interface Stability     Standard
120 MT-Level        MT-Safe, and Async-Signal-Safe
123 .SH SEE ALSO
126 \fBtcdrain\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5), \fBtermio\fR(7I)