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