xref: /netbsd-src/lib/libc/termios/tcsendbreak.3 (revision eb7c1594f145c931049e1fd9eb056a5987e87e59)
1*eb7c1594Sagc.\"	$NetBSD: tcsendbreak.3,v 1.9 2003/08/07 16:44:13 agc Exp $
25f11a56cSjtc.\"
374e3014eSperry.\" Copyright (c) 1991, 1993
474e3014eSperry.\"	The Regents of the University of California.  All rights reserved.
55f11a56cSjtc.\"
65f11a56cSjtc.\" Redistribution and use in source and binary forms, with or without
75f11a56cSjtc.\" modification, are permitted provided that the following conditions
85f11a56cSjtc.\" are met:
95f11a56cSjtc.\" 1. Redistributions of source code must retain the above copyright
105f11a56cSjtc.\"    notice, this list of conditions and the following disclaimer.
115f11a56cSjtc.\" 2. Redistributions in binary form must reproduce the above copyright
125f11a56cSjtc.\"    notice, this list of conditions and the following disclaimer in the
135f11a56cSjtc.\"    documentation and/or other materials provided with the distribution.
14*eb7c1594Sagc.\" 3. Neither the name of the University nor the names of its contributors
155f11a56cSjtc.\"    may be used to endorse or promote products derived from this software
165f11a56cSjtc.\"    without specific prior written permission.
175f11a56cSjtc.\"
185f11a56cSjtc.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
195f11a56cSjtc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
205f11a56cSjtc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
215f11a56cSjtc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
225f11a56cSjtc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
235f11a56cSjtc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
245f11a56cSjtc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
255f11a56cSjtc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
265f11a56cSjtc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
275f11a56cSjtc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
285f11a56cSjtc.\" SUCH DAMAGE.
295f11a56cSjtc.\"
3074e3014eSperry.\"	@(#)tcsendbreak.3	8.1 (Berkeley) 6/4/93
315f11a56cSjtc.\"
32dc1e66a8Sperry.Dd June 4, 1993
335f11a56cSjtc.Dt TCSENDBREAK 3
345f11a56cSjtc.Os
355f11a56cSjtc.Sh NAME
365f11a56cSjtc.Nm tcsendbreak ,
375f11a56cSjtc.Nm tcdrain ,
385f11a56cSjtc.Nm tcflush ,
395f11a56cSjtc.Nm tcflow
405f11a56cSjtc.Nd line control functions
41312aca53Sperry.Sh LIBRARY
42312aca53Sperry.Lb libc
435f11a56cSjtc.Sh SYNOPSIS
44472351e1Swiz.In termios.h
455f11a56cSjtc.Ft int
465f11a56cSjtc.Fn tcdrain "int fd"
475f11a56cSjtc.Ft int
485f11a56cSjtc.Fn tcflow "int fd" "int action"
495f11a56cSjtc.Ft int
505f11a56cSjtc.Fn tcflush "int fd" "int action"
515f11a56cSjtc.Ft int
525f11a56cSjtc.Fn tcsendbreak "int fd" "int len"
535f11a56cSjtc.Sh DESCRIPTION
545f11a56cSjtcThe
555f11a56cSjtc.Nm tcdrain
565f11a56cSjtcfunction waits until all output written to the terminal referenced by
575f11a56cSjtc.Fa fd
585f11a56cSjtchas been transmitted to the terminal.
595f11a56cSjtc.Pp
605f11a56cSjtcThe
615f11a56cSjtc.Nm tcflow
625f11a56cSjtcfunction suspends transmission of data to or the reception of data from
635f11a56cSjtcthe terminal referenced by
645f11a56cSjtc.Fa fd
655f11a56cSjtcdepending on the value of
665f11a56cSjtc.Fa action .
675f11a56cSjtcThe value of
685f11a56cSjtc.Fa action
695f11a56cSjtcmust be one of the following:
705f11a56cSjtc.Bl -tag -width "TCIOFF"
715f11a56cSjtc.It Fa TCOOFF
725f11a56cSjtcSuspend output.
735f11a56cSjtc.It Fa TCOON
745f11a56cSjtcRestart suspended output.
755f11a56cSjtc.It Fa TCIOFF
765f11a56cSjtcTransmit a STOP character, which is intended to cause the terminal to stop
775f11a56cSjtctransmitting data to the system.
785f11a56cSjtc(See the description of IXOFF in the
795f11a56cSjtc.Ql Input Modes
805f11a56cSjtcsection of
815f11a56cSjtc.Xr termios 4 ) .
825f11a56cSjtc.It Fa TCION
835f11a56cSjtcTransmit a START character, which is intended to cause the terminal to start
845f11a56cSjtctransmitting data to the system.
855f11a56cSjtc(See the description of IXOFF in the
865f11a56cSjtc.Ql Input Modes
875f11a56cSjtcsection of
885f11a56cSjtc.Xr termios 4 ) .
895f11a56cSjtc.El
905f11a56cSjtc.Pp
915f11a56cSjtcThe
925f11a56cSjtc.Nm tcflush
935f11a56cSjtcfunction discards any data written to the terminal referenced by
945f11a56cSjtc.Fa fd
955f11a56cSjtcwhich has not been transmitted to the terminal, or any data received
965f11a56cSjtcfrom the terminal but not yet read, depending on the value of
975f11a56cSjtc.Fa action .
985f11a56cSjtcThe value of
995f11a56cSjtc.Fa action
1005f11a56cSjtcmust be one of the following:
1015f11a56cSjtc.Bl -tag -width "TCIOFLUSH"
1025f11a56cSjtc.It Fa TCIFLUSH
1035f11a56cSjtcFlush data received but not read.
1045f11a56cSjtc.It Fa TCOFLUSH
1055f11a56cSjtcFlush data written but not transmitted.
1065f11a56cSjtc.It Fa TCIOFLUSH
1075f11a56cSjtcFlush both data received but not read and data written but not transmitted.
1085f11a56cSjtc.El
1095f11a56cSjtc.Pp
1105f11a56cSjtcThe
1115f11a56cSjtc.Nm tcsendbreak
1125f11a56cSjtcfunction transmits a continuous stream of zero-valued bits for four-tenths
1135f11a56cSjtcof a second to the terminal referenced by
1145f11a56cSjtc.Fa fd .
1155f11a56cSjtcThe
1165f11a56cSjtc.Fa len
1175f11a56cSjtcparameter is ignored in this implementation.
1185f11a56cSjtc.Sh RETURN VALUES
1195f11a56cSjtcUpon successful completion, all of these functions return a value of zero.
1205f11a56cSjtc.Sh ERRORS
1215f11a56cSjtcIf any error occurs, a value of -1 is returned and the global variable
1225f11a56cSjtc.Va errno
1235f11a56cSjtcis set to indicate the error, as follows:
1245f11a56cSjtc.Bl -tag -width Er
1255f11a56cSjtc.It Bq Er EBADF
1265f11a56cSjtcThe
1275f11a56cSjtc.Fa fd
1285f11a56cSjtcargument is not a valid file descriptor.
1295f11a56cSjtc.It Bq Er EINVAL
1305f11a56cSjtcThe
1315f11a56cSjtc.Fa action
1325f11a56cSjtcargument is not a proper value.
1335f11a56cSjtc.It Bq Er ENOTTY
1345f11a56cSjtcThe file associated with
1355f11a56cSjtc.Fa fd
1365f11a56cSjtcis not a terminal.
1375f11a56cSjtc.It Bq Er EINTR
1385f11a56cSjtcA signal interrupted the
1395f11a56cSjtc.Nm tcdrain
1405f11a56cSjtcfunction.
1415f11a56cSjtc.El
1425f11a56cSjtc.Sh SEE ALSO
1435f11a56cSjtc.Xr tcsetattr 3 ,
1445f11a56cSjtc.Xr termios 4
1455f11a56cSjtc.Sh STANDARDS
1465f11a56cSjtcThe
1475f11a56cSjtc.Nm tcsendbreak ,
1485f11a56cSjtc.Nm tcdrain ,
1495f11a56cSjtc.Nm tcflush
1505f11a56cSjtcand
1515f11a56cSjtc.Nm tcflow
1525f11a56cSjtcfunctions are expected to be compliant with the
1535f11a56cSjtc.St -p1003.1-88
1545f11a56cSjtcspecification.
155