1*73be947eSjsg.\" $OpenBSD: tcsendbreak.3,v 1.10 2023/01/12 12:56:07 jsg Exp $ 2df930be7Sderaadt.\" 3df930be7Sderaadt.\" Copyright (c) 1991 The Regents of the University of California. 4df930be7Sderaadt.\" All rights reserved. 5df930be7Sderaadt.\" 6df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 7df930be7Sderaadt.\" modification, are permitted provided that the following conditions 8df930be7Sderaadt.\" are met: 9df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 10df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 11df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 12df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 13df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 146580fee3Smillert.\" 3. Neither the name of the University nor the names of its contributors 15df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 16df930be7Sderaadt.\" without specific prior written permission. 17df930be7Sderaadt.\" 18df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28df930be7Sderaadt.\" SUCH DAMAGE. 29df930be7Sderaadt.\" 30*73be947eSjsg.Dd $Mdocdate: January 12 2023 $ 31df930be7Sderaadt.Dt TCSENDBREAK 3 32df930be7Sderaadt.Os 33df930be7Sderaadt.Sh NAME 34df930be7Sderaadt.Nm tcdrain , 35054695e9Saaron.Nm tcflow , 36df930be7Sderaadt.Nm tcflush , 37054695e9Saaron.Nm tcsendbreak 38df930be7Sderaadt.Nd line control functions 39df930be7Sderaadt.Sh SYNOPSIS 4064d4e987Stedu.In termios.h 41df930be7Sderaadt.Ft int 42df930be7Sderaadt.Fn tcdrain "int fd" 43df930be7Sderaadt.Ft int 44df930be7Sderaadt.Fn tcflow "int fd" "int action" 45df930be7Sderaadt.Ft int 46df930be7Sderaadt.Fn tcflush "int fd" "int action" 47df930be7Sderaadt.Ft int 48df930be7Sderaadt.Fn tcsendbreak "int fd" "int len" 49df930be7Sderaadt.Sh DESCRIPTION 50df930be7SderaadtThe 51054695e9Saaron.Fn tcdrain 52df930be7Sderaadtfunction waits until all output written to the terminal referenced by 53df930be7Sderaadt.Fa fd 54df930be7Sderaadthas been transmitted to the terminal. 55df930be7Sderaadt.Pp 56df930be7SderaadtThe 57054695e9Saaron.Fn tcflow 58df930be7Sderaadtfunction suspends transmission of data to or the reception of data from 59df930be7Sderaadtthe terminal referenced by 60df930be7Sderaadt.Fa fd 61df930be7Sderaadtdepending on the value of 62df930be7Sderaadt.Fa action . 63df930be7SderaadtThe value of 64df930be7Sderaadt.Fa action 65df930be7Sderaadtmust be one of the following: 66df930be7Sderaadt.Bl -tag -width "TCIOFF" 67054695e9Saaron.It Dv TCOOFF 68df930be7SderaadtSuspend output. 69054695e9Saaron.It Dv TCOON 70df930be7SderaadtRestart suspended output. 71054695e9Saaron.It Dv TCIOFF 72df930be7SderaadtTransmit a STOP character, which is intended to cause the terminal to stop 73df930be7Sderaadttransmitting data to the system. 74054695e9Saaron(See the description of 75054695e9Saaron.Dv IXOFF 76054695e9Saaronin the 77df930be7Sderaadt.Ql Input Modes 78df930be7Sderaadtsection of 79df930be7Sderaadt.Xr termios 4 ) . 80054695e9Saaron.It Dv TCION 81df930be7SderaadtTransmit a START character, which is intended to cause the terminal to start 82df930be7Sderaadttransmitting data to the system. 83054695e9Saaron(See the description of 84054695e9Saaron.Dv IXOFF in the 85df930be7Sderaadt.Ql Input Modes 86df930be7Sderaadtsection of 87df930be7Sderaadt.Xr termios 4 ) . 88df930be7Sderaadt.El 89df930be7Sderaadt.Pp 90df930be7SderaadtThe 91054695e9Saaron.Fn tcflush 92df930be7Sderaadtfunction discards any data written to the terminal referenced by 93df930be7Sderaadt.Fa fd 94df930be7Sderaadtwhich has not been transmitted to the terminal, or any data received 95df930be7Sderaadtfrom the terminal but not yet read, depending on the value of 96df930be7Sderaadt.Fa action . 97df930be7SderaadtThe value of 98df930be7Sderaadt.Fa action 99df930be7Sderaadtmust be one of the following: 100df930be7Sderaadt.Bl -tag -width "TCIOFLUSH" 101054695e9Saaron.It Dv TCIFLUSH 102df930be7SderaadtFlush data received but not read. 103054695e9Saaron.It Dv TCOFLUSH 104df930be7SderaadtFlush data written but not transmitted. 105054695e9Saaron.It Dv TCIOFLUSH 106df930be7SderaadtFlush both data received but not read and data written but not transmitted. 107df930be7Sderaadt.El 108df930be7Sderaadt.Pp 109df930be7SderaadtThe 110054695e9Saaron.Fn tcsendbreak 111df930be7Sderaadtfunction transmits a continuous stream of zero-valued bits for four-tenths 112df930be7Sderaadtof a second to the terminal referenced by 113df930be7Sderaadt.Fa fd . 114df930be7SderaadtThe 115df930be7Sderaadt.Fa len 116df930be7Sderaadtparameter is ignored in this implementation. 117df930be7Sderaadt.Sh RETURN VALUES 118df930be7SderaadtUpon successful completion, all of these functions return a value of zero. 119df930be7Sderaadt.Sh ERRORS 120054695e9SaaronIf any error occurs, a value of \-1 is returned and the global variable 121df930be7Sderaadt.Va errno 122df930be7Sderaadtis set to indicate the error, as follows: 123df930be7Sderaadt.Bl -tag -width Er 124df930be7Sderaadt.It Bq Er EBADF 125df930be7SderaadtThe 126df930be7Sderaadt.Fa fd 127df930be7Sderaadtargument is not a valid file descriptor. 128df930be7Sderaadt.It Bq Er EINVAL 129df930be7SderaadtThe 130df930be7Sderaadt.Fa action 131df930be7Sderaadtargument is not a proper value. 132df930be7Sderaadt.It Bq Er ENOTTY 133df930be7SderaadtThe file associated with 134df930be7Sderaadt.Fa fd 135df930be7Sderaadtis not a terminal. 136df930be7Sderaadt.It Bq Er EINTR 137df930be7SderaadtA signal interrupted the 138054695e9Saaron.Fn tcdrain 139df930be7Sderaadtfunction. 140df930be7Sderaadt.El 141df930be7Sderaadt.Sh SEE ALSO 142df930be7Sderaadt.Xr tcsetattr 3 , 143df930be7Sderaadt.Xr termios 4 144df930be7Sderaadt.Sh STANDARDS 145df930be7SderaadtThe 146054695e9Saaron.Fn tcdrain , 147054695e9Saaron.Fn tcflow , 148054695e9Saaron.Fn tcflush , 149df930be7Sderaadtand 150054695e9Saaron.Fn tcsendbreak 151*73be947eSjsgfunctions are compliant with the 152df930be7Sderaadt.St -p1003.1-88 153df930be7Sderaadtspecification. 154