1.\" $NetBSD: tcsendbreak.3,v 1.2 1997/05/29 01:48:28 cgd Exp $ 2.\" 3.\" Copyright (c) 1991 The Regents of the University of California. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)tcsendbreak.3 5.3 (Berkeley) 3/4/92 35.\" 36.Dd March 4, 1992 37.Dt TCSENDBREAK 3 38.Os 39.Sh NAME 40.Nm tcsendbreak , 41.Nm tcdrain , 42.Nm tcflush , 43.Nm tcflow 44.Nd line control functions 45.Sh SYNOPSIS 46.Fd #include <termios.h> 47.Ft int 48.Fn tcdrain "int fd" 49.Ft int 50.Fn tcflow "int fd" "int action" 51.Ft int 52.Fn tcflush "int fd" "int action" 53.Ft int 54.Fn tcsendbreak "int fd" "int len" 55.Sh DESCRIPTION 56The 57.Nm tcdrain 58function waits until all output written to the terminal referenced by 59.Fa fd 60has been transmitted to the terminal. 61.Pp 62The 63.Nm tcflow 64function suspends transmission of data to or the reception of data from 65the terminal referenced by 66.Fa fd 67depending on the value of 68.Fa action . 69The value of 70.Fa action 71must be one of the following: 72.Bl -tag -width "TCIOFF" 73.It Fa TCOOFF 74Suspend output. 75.It Fa TCOON 76Restart suspended output. 77.It Fa TCIOFF 78Transmit a STOP character, which is intended to cause the terminal to stop 79transmitting data to the system. 80(See the description of IXOFF in the 81.Ql Input Modes 82section of 83.Xr termios 4 ). 84.It Fa TCION 85Transmit a START character, which is intended to cause the terminal to start 86transmitting data to the system. 87(See the description of IXOFF in the 88.Ql Input Modes 89section of 90.Xr termios 4 ). 91.El 92.Pp 93The 94.Nm tcflush 95function discards any data written to the terminal referenced by 96.Fa fd 97which has not been transmitted to the terminal, or any data received 98from the terminal but not yet read, depending on the value of 99.Fa action . 100The value of 101.Fa action 102must be one of the following: 103.Bl -tag -width "TCIOFLUSH" 104.It Fa TCIFLUSH 105Flush data received but not read. 106.It Fa TCOFLUSH 107Flush data written but not transmitted. 108.It Fa TCIOFLUSH 109Flush both data received but not read and data written but not transmitted. 110.El 111.Pp 112The 113.Nm tcsendbreak 114function transmits a continuous stream of zero-valued bits for four-tenths 115of a second to the terminal referenced by 116.Fa fd . 117The 118.Fa len 119parameter is ignored in this implementation. 120.Sh RETURN VALUES 121Upon successful completion, all of these functions return a value of zero. 122.Sh ERRORS 123If any error occurs, a value of -1 is returned and the global variable 124.Va errno 125is set to indicate the error, as follows: 126.Bl -tag -width Er 127.It Bq Er EBADF 128The 129.Fa fd 130argument is not a valid file descriptor. 131.It Bq Er EINVAL 132The 133.Fa action 134argument is not a proper value. 135.It Bq Er ENOTTY 136The file associated with 137.Fa fd 138is not a terminal. 139.It Bq Er EINTR 140A signal interrupted the 141.Nm tcdrain 142function. 143.El 144.Sh SEE ALSO 145.Xr tcsetattr 3 , 146.Xr termios 4 147.Sh STANDARDS 148The 149.Nm tcsendbreak , 150.Nm tcdrain , 151.Nm tcflush 152and 153.Nm tcflow 154functions are expected to be compliant with the 155.St -p1003.1-88 156specification. 157