xref: /csrg-svn/lib/libc/gen/tcsendbreak.3 (revision 52294)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)tcsendbreak.3	5.1 (Berkeley) 02/03/92
7.\"
8.Dd Jun 11, 1991
9.Dt LINE 3
10.Os
11.Sh NAME
12.Nm tcsendbreak,
13.Nm tcdrain,
14.Nm tcflush,
15.Nm tcflow
16.LP
17.B "Synopsis"
18.Ft int
19.Fn tcdrain "int fd"
20.Ft int
21.Fn tcflow "int fd" "int action"
22.Ft int
23.Fn tcflush "int fd" "int which"
24.Ft int
25.Fn tcsendbreak "int fd" "int len"
26.nf
27#include <termios.h>
28
29int tcsendbreak(int fildes, int duration);
30int tcdrain(int fildes);
31
32int tcflush(int fildes, int queue_selector);
33int tcflow(int fildes, int action);
34.fi
35.LP
36.B "Description"
37.LP
38If the terminal is using asynchronous serial data transmission, the
39tcsendbreak() function shall cause transmission of a continuous stream of
40zero-valued bits for a specific duration.  If duration is zero, it shall
41cause transmission of zero-valued bits for at least 0.25 seconds, and not
42more that 0.5 seconds.
43.PP
44The tcdrain() function shall wait until all output written to the object
45referred to by fildes has been transmitted.
46.PP
47Upon successful completion, the tcflush() function shall have discarded
48any data written to the object referred to by fildes but not transmitted,
49or data received but not read, depending on the value of queue_selector:
50.nf
51    (1)  If queue_selector is TCIFLUSH, it shall flush data received but
52         not read.
53
54    (2)  If queue_selector is TCOFLUSH, it shall flush data written but
55         not transmitted.
56
57    (3)  If queue_selector is TCIOFLUSH, it shall flush both data
58         received but not read, and data written but not transmitted.
59.fi
60.PP
61The tcflow() function shall suspend transmission or reception of data on
62the object referred to by fildes, depending on the value of action:
63.nf
64    (1)  If action is TCOOFF, it shall suspend output.
65
66    (2)  If action is TCOON, it shall restart suspended output.
67
68    (3)  If action is TCIOFF, the system shall transmit a STOP character,
69         which is intended to cause the terminal device to stop
70         transmitting data to the system.  (See the description of IXOFF
71         in "Input Modes".)
72
73    (4)  If action is TCION, the system shall transmit a START character,
74         which is intended to cause the terminal device to start
75         transmitting data to the system.  (See the description of IXOFF
76         in "Input Modes".)
77.fi
78.LP
79.B "Returns"
80.LP
81Upon successful completion, a value of zero is returned.  Otherwise, a
82value of -1 is returned and errno is set to indicate the error.
83.LP
84.B "Errors"
85.LP
86If any of the following conditions occur, the tcsendbreak() function
87shall return -1 and set errno to the corresponding value:
88.nf
89   [EBADF]       The fildes argument is not a valid file descriptor.
90
91   [ENOTTY]      The file associated with fildes is not a terminal.
92.fi
93.PP
94If any of the following conditions occur, the tcdrain() function shall
95return -1 and set errno to the corresponding value:
96.nf
97   [EBADF]       The fildes argument is not a valid file descriptor.
98
99   [EINTR]       A signal interrupted the tcdrain() function.
100
101   [ENOTTY]      The file associated with fildes is not a terminal.
102.fi
103.PP
104If any of the following conditions occur, the tcflush() function shall
105return -1 and set errno to the corresponding value:
106.nf
107   [EBADF]       The fildes argument is not a valid file descriptor.
108
109   [EINVAL]      The queue_selector argument is not a proper value.
110
111   [ENOTTY]      The file associated with fildes is not a terminal.
112.fi
113.PP
114If any of the following conditions occur, the tcflow() function shall
115return -1 and set errno to the corresponding value:
116.nf
117   [EBADF]       The fildes argument is not a valid file descriptor.
118
119   [EINVAL]      The action argument is not a proper value.
120
121   [ENOTTY]      The file associated with fildes is not a terminal.
122.fi
123