xref: /xnu-10002.41.9/bsd/man/man4/termios.4 (revision 699cd48037512bf4380799317ca44ca453c82f57)
1*699cd480SApple OSS Distributions.\"	$NetBSD: termios.4,v 1.5 1994/11/30 16:22:36 jtc Exp $
2*699cd480SApple OSS Distributions.\"
3*699cd480SApple OSS Distributions.\" Copyright (c) 1991, 1992, 1993
4*699cd480SApple OSS Distributions.\"	The Regents of the University of California.  All rights reserved.
5*699cd480SApple OSS Distributions.\"
6*699cd480SApple OSS Distributions.\" Redistribution and use in source and binary forms, with or without
7*699cd480SApple OSS Distributions.\" modification, are permitted provided that the following conditions
8*699cd480SApple OSS Distributions.\" are met:
9*699cd480SApple OSS Distributions.\" 1. Redistributions of source code must retain the above copyright
10*699cd480SApple OSS Distributions.\"    notice, this list of conditions and the following disclaimer.
11*699cd480SApple OSS Distributions.\" 2. Redistributions in binary form must reproduce the above copyright
12*699cd480SApple OSS Distributions.\"    notice, this list of conditions and the following disclaimer in the
13*699cd480SApple OSS Distributions.\"    documentation and/or other materials provided with the distribution.
14*699cd480SApple OSS Distributions.\" 3. All advertising materials mentioning features or use of this software
15*699cd480SApple OSS Distributions.\"    must display the following acknowledgement:
16*699cd480SApple OSS Distributions.\"	This product includes software developed by the University of
17*699cd480SApple OSS Distributions.\"	California, Berkeley and its contributors.
18*699cd480SApple OSS Distributions.\" 4. Neither the name of the University nor the names of its contributors
19*699cd480SApple OSS Distributions.\"    may be used to endorse or promote products derived from this software
20*699cd480SApple OSS Distributions.\"    without specific prior written permission.
21*699cd480SApple OSS Distributions.\"
22*699cd480SApple OSS Distributions.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23*699cd480SApple OSS Distributions.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24*699cd480SApple OSS Distributions.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25*699cd480SApple OSS Distributions.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26*699cd480SApple OSS Distributions.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27*699cd480SApple OSS Distributions.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28*699cd480SApple OSS Distributions.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29*699cd480SApple OSS Distributions.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30*699cd480SApple OSS Distributions.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31*699cd480SApple OSS Distributions.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32*699cd480SApple OSS Distributions.\" SUCH DAMAGE.
33*699cd480SApple OSS Distributions.\"
34*699cd480SApple OSS Distributions.\"	@(#)termios.4	8.4 (Berkeley) 4/19/94
35*699cd480SApple OSS Distributions.\"
36*699cd480SApple OSS Distributions.Dd April 19, 1994
37*699cd480SApple OSS Distributions.Dt TERMIOS 4
38*699cd480SApple OSS Distributions.Os BSD 4
39*699cd480SApple OSS Distributions.Sh NAME
40*699cd480SApple OSS Distributions.Nm termios
41*699cd480SApple OSS Distributions.Nd general terminal line discipline
42*699cd480SApple OSS Distributions.Sh SYNOPSIS
43*699cd480SApple OSS Distributions.Fd #include <termios.h>
44*699cd480SApple OSS Distributions.Sh DESCRIPTION
45*699cd480SApple OSS DistributionsThis describes a general terminal line discipline that is
46*699cd480SApple OSS Distributionssupported on tty asynchronous communication ports.
47*699cd480SApple OSS Distributions.Ss Opening a Terminal Device File
48*699cd480SApple OSS DistributionsWhen a terminal file is opened, it normally causes the process to wait
49*699cd480SApple OSS Distributionsuntil a connection is established.  For most hardware, the presence
50*699cd480SApple OSS Distributionsof a connection is indicated by the assertion of the hardware
51*699cd480SApple OSS Distributions.Dv CARRIER line.
52*699cd480SApple OSS DistributionsIf the termios structure associated with the terminal file has the
53*699cd480SApple OSS Distributions.Dv CLOCAL
54*699cd480SApple OSS Distributionsflag set in the cflag, or if the
55*699cd480SApple OSS Distributions.Dv O_NONBLOCK
56*699cd480SApple OSS Distributionsflag is set
57*699cd480SApple OSS Distributionsin the
58*699cd480SApple OSS Distributions.Xr open 2
59*699cd480SApple OSS Distributionscall, then the open will succeed even without
60*699cd480SApple OSS Distributionsa connection being present.
61*699cd480SApple OSS DistributionsIn practice, applications
62*699cd480SApple OSS Distributionsseldom open these files; they are opened by special programs, such
63*699cd480SApple OSS Distributionsas
64*699cd480SApple OSS Distributions.Xr getty 2
65*699cd480SApple OSS Distributionsor
66*699cd480SApple OSS Distributions.Xr rlogind 2 ,
67*699cd480SApple OSS Distributionsand become
68*699cd480SApple OSS Distributionsan application's standard input, output, and error files.
69*699cd480SApple OSS Distributions.Ss Job Control in a Nutshell
70*699cd480SApple OSS DistributionsEvery process is associated with a particular process group and session.
71*699cd480SApple OSS DistributionsThe grouping is hierarchical: every member of a particular process group is a
72*699cd480SApple OSS Distributionsmember of the same session.  This structuring is used in managing groups
73*699cd480SApple OSS Distributionsof related processes for purposes of
74*699cd480SApple OSS Distributions.\" .Gw "job control" ;
75*699cd480SApple OSS Distributions.Em "job control" ;
76*699cd480SApple OSS Distributionsthat is, the
77*699cd480SApple OSS Distributionsability from the keyboard (or from program control) to simultaneously
78*699cd480SApple OSS Distributionsstop or restart
79*699cd480SApple OSS Distributionsa complex command (a command composed of one or more related
80*699cd480SApple OSS Distributionsprocesses).  The grouping into process groups allows delivering
81*699cd480SApple OSS Distributionsof signals that stop or start the group as a whole, along with
82*699cd480SApple OSS Distributionsarbitrating which process group has access to the single controlling
83*699cd480SApple OSS Distributionsterminal.  The grouping at a higher layer into sessions is to restrict
84*699cd480SApple OSS Distributionsthe job control related signals and system calls to within processes
85*699cd480SApple OSS Distributionsresulting from a particular instance of a "login".  Typically, a session
86*699cd480SApple OSS Distributionsis created when a user logs in, and the login terminal is setup
87*699cd480SApple OSS Distributionsto be the controlling terminal; all processes spawned from that
88*699cd480SApple OSS Distributionslogin shell are in the same session, and inherit the controlling
89*699cd480SApple OSS Distributionsterminal.
90*699cd480SApple OSS DistributionsA job control shell
91*699cd480SApple OSS Distributionsoperating interactively (that is, reading commands from a terminal)
92*699cd480SApple OSS Distributionsnormally groups related processes together by placing them into the
93*699cd480SApple OSS Distributionssame process group.  A set of processes in the same process group
94*699cd480SApple OSS Distributionsis collectively referred to as a "job". When the foreground process
95*699cd480SApple OSS Distributionsgroup of the terminal is the same as the process group of a particular
96*699cd480SApple OSS Distributionsjob, that job is said to be in the "foreground".  When the process
97*699cd480SApple OSS Distributionsgroup of the terminal is different than the process group of
98*699cd480SApple OSS Distributionsa job (but is still the controlling terminal), that job is said
99*699cd480SApple OSS Distributionsto be in the "background".  Normally the
100*699cd480SApple OSS Distributionsshell reads a command and starts the job that implements that
101*699cd480SApple OSS Distributionscommand.  If the command is to be started in the foreground (typical), it
102*699cd480SApple OSS Distributionssets the process group of the terminal to the process group
103*699cd480SApple OSS Distributionsof the started job, waits for the job to complete, and then
104*699cd480SApple OSS Distributionssets the process group of the terminal back to its own process
105*699cd480SApple OSS Distributionsgroup (it puts itself into the foreground).  If the job is to
106*699cd480SApple OSS Distributionsbe started in the background (as denoted by the shell operator "&"),
107*699cd480SApple OSS Distributionsit never changes the process group of the terminal and doesn't
108*699cd480SApple OSS Distributionswait for the job to complete (that is, it immediately attempts to read the next
109*699cd480SApple OSS Distributionscommand).  If the job is started in the foreground, the user may
110*699cd480SApple OSS Distributionstype a key (usually
111*699cd480SApple OSS Distributions.Ql \&^Z )
112*699cd480SApple OSS Distributionswhich generates the terminal stop signal
113*699cd480SApple OSS Distributions.Pq Dv SIGTSTP
114*699cd480SApple OSS Distributionsand has the affect of stopping the entire job.
115*699cd480SApple OSS DistributionsThe shell will notice that the job stopped, and will resume running after
116*699cd480SApple OSS Distributionsplacing itself in the foreground.
117*699cd480SApple OSS DistributionsThe shell also has commands for placing stopped jobs in the background,
118*699cd480SApple OSS Distributionsand for placing stopped or background jobs into the foreground.
119*699cd480SApple OSS Distributions.Ss Orphaned Process Groups
120*699cd480SApple OSS DistributionsAn orphaned process group is a process group that has no process
121*699cd480SApple OSS Distributionswhose parent is in a different process group, yet is in the same
122*699cd480SApple OSS Distributionssession.  Conceptually it means a process group that doesn't have
123*699cd480SApple OSS Distributionsa parent that could do anything if it were to be stopped.  For example,
124*699cd480SApple OSS Distributionsthe initial login shell is typically in an orphaned process group.
125*699cd480SApple OSS DistributionsOrphaned process groups are immune to keyboard generated stop
126*699cd480SApple OSS Distributionssignals and job control signals resulting from reads or writes to the
127*699cd480SApple OSS Distributionscontrolling terminal.
128*699cd480SApple OSS Distributions.Ss The Controlling Terminal
129*699cd480SApple OSS DistributionsA terminal may belong to a process as its controlling terminal.  Each
130*699cd480SApple OSS Distributionsprocess of a session that has a controlling terminal has the same
131*699cd480SApple OSS Distributionscontrolling terminal.  A terminal may be the controlling terminal for at
132*699cd480SApple OSS Distributionsmost one session.  The controlling terminal for a session is allocated by
133*699cd480SApple OSS Distributionsthe session leader by issuing the
134*699cd480SApple OSS Distributions.Dv TIOCSCTTY
135*699cd480SApple OSS Distributionsioctl.  A controlling terminal
136*699cd480SApple OSS Distributionsis never acquired by merely opening a terminal device file.
137*699cd480SApple OSS DistributionsWhen a controlling terminal becomes
138*699cd480SApple OSS Distributionsassociated with a session, its foreground process group is set to
139*699cd480SApple OSS Distributionsthe process group of the session leader.
140*699cd480SApple OSS Distributions.Pp
141*699cd480SApple OSS DistributionsThe controlling terminal is inherited by a child process during a
142*699cd480SApple OSS Distributions.Xr fork 2
143*699cd480SApple OSS Distributionsfunction call.  A process relinquishes its controlling terminal when it
144*699cd480SApple OSS Distributionscreates a new session with the
145*699cd480SApple OSS Distributions.Xr setsid 2
146*699cd480SApple OSS Distributionsfunction; other processes
147*699cd480SApple OSS Distributionsremaining in the old session that had this terminal as their controlling
148*699cd480SApple OSS Distributionsterminal continue to have it.
149*699cd480SApple OSS DistributionsA process does not relinquish its
150*699cd480SApple OSS Distributionscontrolling terminal simply by closing all of its file descriptors
151*699cd480SApple OSS Distributionsassociated with the controlling terminal if other processes continue to
152*699cd480SApple OSS Distributionshave it open.
153*699cd480SApple OSS Distributions.Pp
154*699cd480SApple OSS DistributionsWhen a controlling process terminates, the controlling terminal is
155*699cd480SApple OSS Distributionsdisassociated from the current session, allowing it to be acquired by a
156*699cd480SApple OSS Distributionsnew session leader.  Subsequent access to the terminal by other processes
157*699cd480SApple OSS Distributionsin the earlier session will be denied, with attempts to access the
158*699cd480SApple OSS Distributionsterminal treated as if modem disconnect had been sensed.
159*699cd480SApple OSS Distributions.Ss Terminal Access Control
160*699cd480SApple OSS DistributionsIf a process is in the foreground process group of its controlling
161*699cd480SApple OSS Distributionsterminal, read operations are allowed.
162*699cd480SApple OSS DistributionsAny attempts by a process
163*699cd480SApple OSS Distributionsin a background process group to read from its controlling terminal
164*699cd480SApple OSS Distributionscauses a
165*699cd480SApple OSS Distributions.Dv SIGTTIN
166*699cd480SApple OSS Distributionssignal to be sent to
167*699cd480SApple OSS Distributionsthe process's group
168*699cd480SApple OSS Distributionsunless one of the
169*699cd480SApple OSS Distributionsfollowing special cases apply:  If the reading process is ignoring or
170*699cd480SApple OSS Distributionsblocking the
171*699cd480SApple OSS Distributions.Dv SIGTTIN signal, or if the process group of the reading
172*699cd480SApple OSS Distributionsprocess is orphaned, the
173*699cd480SApple OSS Distributions.Xr read 2
174*699cd480SApple OSS Distributionsreturns -1 with
175*699cd480SApple OSS Distributions.Va errno set to
176*699cd480SApple OSS Distributions.Er EIO
177*699cd480SApple OSS Distributionsand no
178*699cd480SApple OSS Distributionssignal is sent.  The default action of the
179*699cd480SApple OSS Distributions.Dv SIGTTIN
180*699cd480SApple OSS Distributionssignal is to stop the
181*699cd480SApple OSS Distributionsprocess to which it is sent.
182*699cd480SApple OSS Distributions.Pp
183*699cd480SApple OSS DistributionsIf a process is in the foreground process group of its controlling
184*699cd480SApple OSS Distributionsterminal, write operations are allowed.
185*699cd480SApple OSS DistributionsAttempts by a process in a background process group to write to its
186*699cd480SApple OSS Distributionscontrolling terminal will cause the process group to be sent a
187*699cd480SApple OSS Distributions.Dv SIGTTOU
188*699cd480SApple OSS Distributionssignal unless one of the following special cases apply:  If
189*699cd480SApple OSS Distributions.Dv TOSTOP
190*699cd480SApple OSS Distributionsis not
191*699cd480SApple OSS Distributionsset, or if
192*699cd480SApple OSS Distributions.Dv TOSTOP
193*699cd480SApple OSS Distributionsis set and the process is ignoring or blocking the
194*699cd480SApple OSS Distributions.Dv SIGTTOU
195*699cd480SApple OSS Distributionssignal, the process is allowed to write to the terminal and the
196*699cd480SApple OSS Distributions.Dv SIGTTOU
197*699cd480SApple OSS Distributionssignal is not sent.  If
198*699cd480SApple OSS Distributions.Dv TOSTOP
199*699cd480SApple OSS Distributionsis set, and the process group of
200*699cd480SApple OSS Distributionsthe writing process is orphaned, and the writing process is not ignoring
201*699cd480SApple OSS Distributionsor blocking
202*699cd480SApple OSS Distributions.Dv SIGTTOU ,
203*699cd480SApple OSS Distributionsthe
204*699cd480SApple OSS Distributions.Xr write
205*699cd480SApple OSS Distributionsreturns -1 with
206*699cd480SApple OSS Distributionserrno set to
207*699cd480SApple OSS Distributions.Er EIO
208*699cd480SApple OSS Distributionsand no signal is sent.
209*699cd480SApple OSS Distributions.Pp
210*699cd480SApple OSS DistributionsCertain calls that set terminal parameters are treated in the same
211*699cd480SApple OSS Distributionsfashion as write, except that
212*699cd480SApple OSS Distributions.Dv TOSTOP
213*699cd480SApple OSS Distributionsis ignored; that is, the effect is
214*699cd480SApple OSS Distributionsidentical to that of terminal writes when
215*699cd480SApple OSS Distributions.Dv TOSTOP
216*699cd480SApple OSS Distributionsis set.
217*699cd480SApple OSS Distributions.Ss Input Processing and Reading Data
218*699cd480SApple OSS DistributionsA terminal device associated with a terminal device file may operate in
219*699cd480SApple OSS Distributionsfull-duplex mode, so that data may arrive even while output is occurring.
220*699cd480SApple OSS DistributionsEach terminal device file has associated with it an input queue, into
221*699cd480SApple OSS Distributionswhich incoming data is stored by the system before being read by a
222*699cd480SApple OSS Distributionsprocess.  The system imposes a limit,
223*699cd480SApple OSS Distributions.Pf \&{ Dv MAX_INPUT Ns \&} ,
224*699cd480SApple OSS Distributionson the number of
225*699cd480SApple OSS Distributionsbytes that may be stored in the input queue.  The behavior of the system
226*699cd480SApple OSS Distributionswhen this limit is exceeded depends on the setting of the
227*699cd480SApple OSS Distributions.Dv IMAXBEL
228*699cd480SApple OSS Distributionsflag in the termios
229*699cd480SApple OSS Distributions.Fa c_iflag .
230*699cd480SApple OSS DistributionsIf this flag is set, the terminal
231*699cd480SApple OSS Distributionsis sent an
232*699cd480SApple OSS Distributions.Tn ASCII
233*699cd480SApple OSS Distributions.Dv BEL
234*699cd480SApple OSS Distributionscharacter each time a character is received
235*699cd480SApple OSS Distributionswhile the input queue is full.  Otherwise, the input queue is flushed
236*699cd480SApple OSS Distributionsupon receiving the character.
237*699cd480SApple OSS Distributions.Pp
238*699cd480SApple OSS DistributionsTwo general kinds of input processing are available, determined by
239*699cd480SApple OSS Distributionswhether the terminal device file is in canonical mode or noncanonical
240*699cd480SApple OSS Distributionsmode. Additionally,
241*699cd480SApple OSS Distributionsinput characters are processed according to the
242*699cd480SApple OSS Distributions.Fa c_iflag
243*699cd480SApple OSS Distributionsand
244*699cd480SApple OSS Distributions.Fa c_lflag
245*699cd480SApple OSS Distributionsfields.  Such processing can include echoing, which
246*699cd480SApple OSS Distributionsin general means transmitting input characters immediately back to the
247*699cd480SApple OSS Distributionsterminal when they are received from the terminal.  This is useful for
248*699cd480SApple OSS Distributionsterminals that can operate in full-duplex mode.
249*699cd480SApple OSS Distributions.Pp
250*699cd480SApple OSS DistributionsThe manner in which data is provided to a process reading from a terminal
251*699cd480SApple OSS Distributionsdevice file is dependent on whether the terminal device file is in
252*699cd480SApple OSS Distributionscanonical or noncanonical mode.
253*699cd480SApple OSS Distributions.Pp
254*699cd480SApple OSS DistributionsAnother dependency is whether the
255*699cd480SApple OSS Distributions.Dv O_NONBLOCK
256*699cd480SApple OSS Distributionsflag is set by
257*699cd480SApple OSS Distributions.Xr open()
258*699cd480SApple OSS Distributionsor
259*699cd480SApple OSS Distributions.Xr fcntl() .
260*699cd480SApple OSS DistributionsIf the
261*699cd480SApple OSS Distributions.Dv O_NONBLOCK
262*699cd480SApple OSS Distributionsflag is clear, then the read request is
263*699cd480SApple OSS Distributionsblocked until data is available or a signal has been received.  If the
264*699cd480SApple OSS Distributions.Dv O_NONBLOCK
265*699cd480SApple OSS Distributionsflag is set, then the read request is completed, without
266*699cd480SApple OSS Distributionsblocking, in one of three ways:
267*699cd480SApple OSS Distributions.Bl -enum -offset indent
268*699cd480SApple OSS Distributions.It
269*699cd480SApple OSS DistributionsIf there is enough data available to satisfy the entire request,
270*699cd480SApple OSS Distributionsand the read completes successfully the number of
271*699cd480SApple OSS Distributionsbytes read is returned.
272*699cd480SApple OSS Distributions.It
273*699cd480SApple OSS DistributionsIf there is not enough data available to satisfy the entire
274*699cd480SApple OSS Distributionsrequest, and the read completes successfully, having read as
275*699cd480SApple OSS Distributionsmuch data as possible, the number of bytes read is returned.
276*699cd480SApple OSS Distributions.It
277*699cd480SApple OSS DistributionsIf there is no data available, the read returns -1, with
278*699cd480SApple OSS Distributionserrno set to
279*699cd480SApple OSS Distributions.Er EAGAIN .
280*699cd480SApple OSS Distributions.El
281*699cd480SApple OSS Distributions.Pp
282*699cd480SApple OSS DistributionsWhen data is available depends on whether the input processing mode is
283*699cd480SApple OSS Distributionscanonical or noncanonical.
284*699cd480SApple OSS Distributions.Ss Canonical Mode Input Processing
285*699cd480SApple OSS DistributionsIn canonical mode input processing, terminal input is processed in units
286*699cd480SApple OSS Distributionsof lines.  A line is delimited by a newline
287*699cd480SApple OSS Distributions.Ql \&\en
288*699cd480SApple OSS Distributionscharacter, an end-of-file
289*699cd480SApple OSS Distributions.Pq Dv EOF
290*699cd480SApple OSS Distributionscharacter, or an end-of-line
291*699cd480SApple OSS Distributions.Pq Dv EOL
292*699cd480SApple OSS Distributionscharacter.  See the
293*699cd480SApple OSS Distributions.Sx "Special Characters"
294*699cd480SApple OSS Distributionssection for
295*699cd480SApple OSS Distributionsmore information on
296*699cd480SApple OSS Distributions.Dv EOF
297*699cd480SApple OSS Distributionsand
298*699cd480SApple OSS Distributions.Dv EOL .
299*699cd480SApple OSS DistributionsThis means that a read request will
300*699cd480SApple OSS Distributionsnot return until an entire line has been typed, or a signal has been
301*699cd480SApple OSS Distributionsreceived.  Also, no matter how many bytes are requested in the read call,
302*699cd480SApple OSS Distributionsat most one line is returned.  It is not, however, necessary to
303*699cd480SApple OSS Distributionsread a whole line at once; any number of bytes, even one, may be
304*699cd480SApple OSS Distributionsrequested in a read without losing information.
305*699cd480SApple OSS Distributions.Pp
306*699cd480SApple OSS Distributions.Pf \&{ Dv MAX_CANON Ns \&}
307*699cd480SApple OSS Distributionsis a limit on the
308*699cd480SApple OSS Distributionsnumber of bytes in a line.
309*699cd480SApple OSS DistributionsThe behavior of the system when this limit is
310*699cd480SApple OSS Distributionsexceeded is the same as when the input queue limit
311*699cd480SApple OSS Distributions.Pf \&{ Dv MAX_INPUT Ns \&} ,
312*699cd480SApple OSS Distributionsis exceeded.
313*699cd480SApple OSS Distributions.Pp
314*699cd480SApple OSS DistributionsErase and kill processing occur when either of two special characters,
315*699cd480SApple OSS Distributionsthe
316*699cd480SApple OSS Distributions.Dv ERASE
317*699cd480SApple OSS Distributionsand
318*699cd480SApple OSS Distributions.Dv KILL
319*699cd480SApple OSS Distributionscharacters (see the
320*699cd480SApple OSS Distributions.Sx "Special Characters section" ) ,
321*699cd480SApple OSS Distributionsis received.
322*699cd480SApple OSS DistributionsThis processing affects data in the input queue that has not yet been
323*699cd480SApple OSS Distributionsdelimited by a newline
324*699cd480SApple OSS Distributions.Dv NL,
325*699cd480SApple OSS Distributions.Dv EOF ,
326*699cd480SApple OSS Distributionsor
327*699cd480SApple OSS Distributions.Dv EOL
328*699cd480SApple OSS Distributionscharacter.  This un-delimited
329*699cd480SApple OSS Distributionsdata makes up the current line.  The
330*699cd480SApple OSS Distributions.Dv ERASE
331*699cd480SApple OSS Distributionscharacter deletes the last
332*699cd480SApple OSS Distributionscharacter in the current line, if there is any.  The
333*699cd480SApple OSS Distributions.Dv KILL
334*699cd480SApple OSS Distributionscharacter
335*699cd480SApple OSS Distributionsdeletes all data in the current line, if there is any.  The
336*699cd480SApple OSS Distributions.Dv ERASE
337*699cd480SApple OSS Distributionsand
338*699cd480SApple OSS Distributions.Dv KILL
339*699cd480SApple OSS Distributionscharacters have no effect if there is no data in the current line.
340*699cd480SApple OSS DistributionsThe
341*699cd480SApple OSS Distributions.Dv ERASE
342*699cd480SApple OSS Distributionsand
343*699cd480SApple OSS Distributions.Dv KILL
344*699cd480SApple OSS Distributionscharacters themselves are not placed in the input
345*699cd480SApple OSS Distributionsqueue.
346*699cd480SApple OSS Distributions.Ss Noncanonical Mode Input Processing
347*699cd480SApple OSS DistributionsIn noncanonical mode input processing, input bytes are not assembled into
348*699cd480SApple OSS Distributionslines, and erase and kill processing does not occur.  The values of the
349*699cd480SApple OSS Distributions.Dv MIN
350*699cd480SApple OSS Distributionsand
351*699cd480SApple OSS Distributions.Dv TIME
352*699cd480SApple OSS Distributionsmembers of the
353*699cd480SApple OSS Distributions.Fa c_cc
354*699cd480SApple OSS Distributionsarray are used to determine how to
355*699cd480SApple OSS Distributionsprocess the bytes received.
356*699cd480SApple OSS Distributions.Pp
357*699cd480SApple OSS Distributions.Dv MIN
358*699cd480SApple OSS Distributionsrepresents the minimum number of bytes that should be received when
359*699cd480SApple OSS Distributionsthe
360*699cd480SApple OSS Distributions.Xr read
361*699cd480SApple OSS Distributionsfunction successfully returns.
362*699cd480SApple OSS Distributions.Dv TIME
363*699cd480SApple OSS Distributionsis a timer of 0.1 second
364*699cd480SApple OSS Distributionsgranularity that is used to time out bursty and short term data
365*699cd480SApple OSS Distributionstransmissions.  If
366*699cd480SApple OSS Distributions.Dv MIN
367*699cd480SApple OSS Distributionsis greater than
368*699cd480SApple OSS Distributions.Dv \&{ Dv MAX_INPUT Ns \&} ,
369*699cd480SApple OSS Distributionsthe response to the
370*699cd480SApple OSS Distributionsrequest is undefined.  The four possible values for
371*699cd480SApple OSS Distributions.Dv MIN
372*699cd480SApple OSS Distributionsand
373*699cd480SApple OSS Distributions.Dv TIME
374*699cd480SApple OSS Distributionsand
375*699cd480SApple OSS Distributionstheir interactions are described below.
376*699cd480SApple OSS Distributions.Ss "Case A: MIN > 0, TIME > 0"
377*699cd480SApple OSS DistributionsIn this case
378*699cd480SApple OSS Distributions.Dv TIME
379*699cd480SApple OSS Distributionsserves as an inter-byte timer and is activated after
380*699cd480SApple OSS Distributionsthe first byte is received.  Since it is an inter-byte timer, it is reset
381*699cd480SApple OSS Distributionsafter a byte is received.  The interaction between
382*699cd480SApple OSS Distributions.Dv MIN
383*699cd480SApple OSS Distributionsand
384*699cd480SApple OSS Distributions.Dv TIME
385*699cd480SApple OSS Distributionsis as
386*699cd480SApple OSS Distributionsfollows:  as soon as one byte is received, the inter-byte timer is
387*699cd480SApple OSS Distributionsstarted.  If
388*699cd480SApple OSS Distributions.Dv MIN
389*699cd480SApple OSS Distributionsbytes are received before the inter-byte timer expires
390*699cd480SApple OSS Distributions(remember that the timer is reset upon receipt of each byte), the read is
391*699cd480SApple OSS Distributionssatisfied.  If the timer expires before
392*699cd480SApple OSS Distributions.Dv MIN
393*699cd480SApple OSS Distributionsbytes are received, the
394*699cd480SApple OSS Distributionscharacters received to that point are returned to the user.  Note that if
395*699cd480SApple OSS Distributions.Dv TIME
396*699cd480SApple OSS Distributionsexpires at least one byte is returned because the timer would
397*699cd480SApple OSS Distributionsnot have been enabled unless a byte was received.  In this case
398*699cd480SApple OSS Distributions.Pf \&( Dv MIN
399*699cd480SApple OSS Distributions> 0,
400*699cd480SApple OSS Distributions.Dv TIME
401*699cd480SApple OSS Distributions> 0) the read blocks until the
402*699cd480SApple OSS Distributions.Dv MIN
403*699cd480SApple OSS Distributionsand
404*699cd480SApple OSS Distributions.Dv TIME
405*699cd480SApple OSS Distributionsmechanisms are
406*699cd480SApple OSS Distributionsactivated by the receipt of the first byte, or a signal is received.  If
407*699cd480SApple OSS Distributionsdata is in the buffer at the time of the read(), the result is as
408*699cd480SApple OSS Distributionsif data had been received immediately after the read().
409*699cd480SApple OSS Distributions.Ss "Case B: MIN > 0, TIME = 0"
410*699cd480SApple OSS DistributionsIn this case, since the value of
411*699cd480SApple OSS Distributions.Dv TIME
412*699cd480SApple OSS Distributionsis zero, the timer plays no role
413*699cd480SApple OSS Distributionsand only
414*699cd480SApple OSS Distributions.Dv MIN
415*699cd480SApple OSS Distributionsis significant.  A pending read is not satisfied until
416*699cd480SApple OSS Distributions.Dv MIN
417*699cd480SApple OSS Distributionsbytes are received (i.e., the pending read blocks until
418*699cd480SApple OSS Distributions.Dv MIN
419*699cd480SApple OSS Distributionsbytes
420*699cd480SApple OSS Distributionsare received), or a signal is received.  A program that uses this case to
421*699cd480SApple OSS Distributionsread record-based terminal
422*699cd480SApple OSS Distributions.Dv I/O
423*699cd480SApple OSS Distributionsmay block indefinitely in the read
424*699cd480SApple OSS Distributionsoperation.
425*699cd480SApple OSS Distributions.Ss "Case C: MIN = 0, TIME > 0"
426*699cd480SApple OSS DistributionsIn this case, since
427*699cd480SApple OSS Distributions.Dv MIN
428*699cd480SApple OSS Distributions= 0,
429*699cd480SApple OSS Distributions.Dv TIME
430*699cd480SApple OSS Distributionsno longer represents an inter-byte
431*699cd480SApple OSS Distributionstimer.  It now serves as a read timer that is activated as soon as the
432*699cd480SApple OSS Distributionsread function is processed.  A read is satisfied as soon as a single
433*699cd480SApple OSS Distributionsbyte is received or the read timer expires.  Note that in this case if
434*699cd480SApple OSS Distributionsthe timer expires, no bytes are returned.  If the timer does not
435*699cd480SApple OSS Distributionsexpire, the only way the read can be satisfied is if a byte is received.
436*699cd480SApple OSS DistributionsIn this case the read will not block indefinitely waiting for a byte; if
437*699cd480SApple OSS Distributionsno byte is received within
438*699cd480SApple OSS Distributions.Dv TIME Ns *0.1
439*699cd480SApple OSS Distributionsseconds after the read is initiated,
440*699cd480SApple OSS Distributionsthe read returns a value of zero, having read no data.  If data is
441*699cd480SApple OSS Distributionsin the buffer at the time of the read, the timer is started as if
442*699cd480SApple OSS Distributionsdata had been received immediately after the read.
443*699cd480SApple OSS Distributions.Ss Case D: MIN = 0, TIME = 0
444*699cd480SApple OSS DistributionsThe minimum of either the number of bytes requested or the number of
445*699cd480SApple OSS Distributionsbytes currently available is returned without waiting for more
446*699cd480SApple OSS Distributionsbytes to be input.  If no characters are available, read returns a
447*699cd480SApple OSS Distributionsvalue of zero, having read no data.
448*699cd480SApple OSS Distributions.Ss Writing Data and Output Processing
449*699cd480SApple OSS DistributionsWhen a process writes one or more bytes to a terminal device file, they
450*699cd480SApple OSS Distributionsare processed according to the
451*699cd480SApple OSS Distributions.Fa c_oflag
452*699cd480SApple OSS Distributionsfield (see the
453*699cd480SApple OSS Distributions.Sx "Output Modes
454*699cd480SApple OSS Distributionssection).  The
455*699cd480SApple OSS Distributionsimplementation may provide a buffering mechanism; as such, when a call to
456*699cd480SApple OSS Distributionswrite() completes, all of the bytes written have been scheduled for
457*699cd480SApple OSS Distributionstransmission to the device, but the transmission will not necessarily
458*699cd480SApple OSS Distributionshave been completed.
459*699cd480SApple OSS Distributions.\" See also .Sx "6.4.2" for the effects of
460*699cd480SApple OSS Distributions.\" .Dv O_NONBLOCK
461*699cd480SApple OSS Distributions.\" on write.
462*699cd480SApple OSS Distributions.Ss Special Characters
463*699cd480SApple OSS DistributionsCertain characters have special functions on input or output or both.
464*699cd480SApple OSS DistributionsThese functions are summarized as follows:
465*699cd480SApple OSS Distributions.Bl -tag -width indent
466*699cd480SApple OSS Distributions.It Dv INTR
467*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
468*699cd480SApple OSS Distributions.Dv ISIG
469*699cd480SApple OSS Distributionsflag (see the
470*699cd480SApple OSS Distributions.Sx "Local Modes"
471*699cd480SApple OSS Distributionssection) is enabled.  Generates a
472*699cd480SApple OSS Distributions.Dv SIGINT
473*699cd480SApple OSS Distributionssignal which is sent to all processes in the foreground
474*699cd480SApple OSS Distributionsprocess group for which the terminal is the controlling
475*699cd480SApple OSS Distributionsterminal.  If
476*699cd480SApple OSS Distributions.Dv ISIG
477*699cd480SApple OSS Distributionsis set, the
478*699cd480SApple OSS Distributions.Dv INTR
479*699cd480SApple OSS Distributionscharacter is
480*699cd480SApple OSS Distributionsdiscarded when processed.
481*699cd480SApple OSS Distributions.It Dv QUIT
482*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
483*699cd480SApple OSS Distributions.Dv ISIG
484*699cd480SApple OSS Distributionsflag is enabled.  Generates a
485*699cd480SApple OSS Distributions.Dv SIGQUIT
486*699cd480SApple OSS Distributionssignal which is
487*699cd480SApple OSS Distributionssent to all processes in the foreground process group
488*699cd480SApple OSS Distributionsfor which the terminal is the controlling terminal.  If
489*699cd480SApple OSS Distributions.Dv ISIG
490*699cd480SApple OSS Distributionsis set, the
491*699cd480SApple OSS Distributions.Dv QUIT
492*699cd480SApple OSS Distributionscharacter is discarded when
493*699cd480SApple OSS Distributionsprocessed.
494*699cd480SApple OSS Distributions.It Dv ERASE
495*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
496*699cd480SApple OSS Distributions.Dv ICANON
497*699cd480SApple OSS Distributionsflag is set.  Erases the last character in the
498*699cd480SApple OSS Distributionscurrent line; see
499*699cd480SApple OSS Distributions.Sx "Canonical Mode Input Processing" .
500*699cd480SApple OSS DistributionsIt does not erase beyond
501*699cd480SApple OSS Distributionsthe start of a line, as delimited by an
502*699cd480SApple OSS Distributions.Dv NL ,
503*699cd480SApple OSS Distributions.Dv EOF ,
504*699cd480SApple OSS Distributionsor
505*699cd480SApple OSS Distributions.Dv EOL
506*699cd480SApple OSS Distributionscharacter.  If
507*699cd480SApple OSS Distributions.Dv ICANON
508*699cd480SApple OSS Distributionsis set, the
509*699cd480SApple OSS Distributions.Dv ERASE
510*699cd480SApple OSS Distributionscharacter is
511*699cd480SApple OSS Distributionsdiscarded when processed.
512*699cd480SApple OSS Distributions.It Dv KILL
513*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
514*699cd480SApple OSS Distributions.Dv ICANON
515*699cd480SApple OSS Distributionsflag is set.  Deletes the entire line, as
516*699cd480SApple OSS Distributionsdelimited by a
517*699cd480SApple OSS Distributions.Dv NL ,
518*699cd480SApple OSS Distributions.Dv EOF ,
519*699cd480SApple OSS Distributionsor
520*699cd480SApple OSS Distributions.Dv EOL
521*699cd480SApple OSS Distributionscharacter.  If
522*699cd480SApple OSS Distributions.Dv ICANON
523*699cd480SApple OSS Distributionsis set, the
524*699cd480SApple OSS Distributions.Dv KILL
525*699cd480SApple OSS Distributionscharacter is discarded when processed.
526*699cd480SApple OSS Distributions.It Dv EOF
527*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
528*699cd480SApple OSS Distributions.Dv ICANON
529*699cd480SApple OSS Distributionsflag is set.  When received, all the bytes
530*699cd480SApple OSS Distributionswaiting to be read are immediately passed to the
531*699cd480SApple OSS Distributionsprocess, without waiting for a newline, and the
532*699cd480SApple OSS Distributions.Dv EOF
533*699cd480SApple OSS Distributionsis discarded.  Thus, if there are no bytes waiting (that
534*699cd480SApple OSS Distributionsis, the
535*699cd480SApple OSS Distributions.Dv EOF
536*699cd480SApple OSS Distributionsoccurred at the beginning of a line), a byte
537*699cd480SApple OSS Distributionscount of zero is returned from the read(),
538*699cd480SApple OSS Distributionsrepresenting an end-of-file indication.  If
539*699cd480SApple OSS Distributions.Dv ICANON
540*699cd480SApple OSS Distributionsis
541*699cd480SApple OSS Distributionsset, the
542*699cd480SApple OSS Distributions.Dv EOF
543*699cd480SApple OSS Distributionscharacter is discarded when processed.
544*699cd480SApple OSS Distributions.Dv NL
545*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
546*699cd480SApple OSS Distributions.Dv ICANON
547*699cd480SApple OSS Distributionsflag is set.  It is the line delimiter
548*699cd480SApple OSS Distributions.Ql \&\en .
549*699cd480SApple OSS Distributions.It Dv EOL
550*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
551*699cd480SApple OSS Distributions.Dv ICANON
552*699cd480SApple OSS Distributionsflag is set.  Is an additional line delimiter,
553*699cd480SApple OSS Distributionslike
554*699cd480SApple OSS Distributions.Dv NL .
555*699cd480SApple OSS Distributions.It Dv SUSP
556*699cd480SApple OSS DistributionsIf the
557*699cd480SApple OSS Distributions.Dv ISIG
558*699cd480SApple OSS Distributionsflag is enabled, receipt of the
559*699cd480SApple OSS Distributions.Dv SUSP
560*699cd480SApple OSS Distributionscharacter causes a
561*699cd480SApple OSS Distributions.Dv SIGTSTP
562*699cd480SApple OSS Distributionssignal to be sent to all processes in the
563*699cd480SApple OSS Distributionsforeground process group for which the terminal is the
564*699cd480SApple OSS Distributionscontrolling terminal, and the
565*699cd480SApple OSS Distributions.Dv SUSP
566*699cd480SApple OSS Distributionscharacter is
567*699cd480SApple OSS Distributionsdiscarded when processed.
568*699cd480SApple OSS Distributions.It Dv STOP
569*699cd480SApple OSS DistributionsSpecial character on both input and output and is
570*699cd480SApple OSS Distributionsrecognized if the
571*699cd480SApple OSS Distributions.Dv IXON
572*699cd480SApple OSS Distributions(output control) or
573*699cd480SApple OSS Distributions.Dv IXOFF
574*699cd480SApple OSS Distributions(input
575*699cd480SApple OSS Distributionscontrol) flag is set.  Can be used to temporarily
576*699cd480SApple OSS Distributionssuspend output.  It is useful with fast terminals to
577*699cd480SApple OSS Distributionsprevent output from disappearing before it can be read.
578*699cd480SApple OSS DistributionsIf
579*699cd480SApple OSS Distributions.Dv IXON
580*699cd480SApple OSS Distributionsis set, the
581*699cd480SApple OSS Distributions.Dv STOP
582*699cd480SApple OSS Distributionscharacter is discarded when
583*699cd480SApple OSS Distributionsprocessed.
584*699cd480SApple OSS Distributions.It Dv START
585*699cd480SApple OSS DistributionsSpecial character on both input and output and is
586*699cd480SApple OSS Distributionsrecognized if the
587*699cd480SApple OSS Distributions.Dv IXON
588*699cd480SApple OSS Distributions(output control) or
589*699cd480SApple OSS Distributions.Dv IXOFF
590*699cd480SApple OSS Distributions(input
591*699cd480SApple OSS Distributionscontrol) flag is set.  Can be used to resume output that
592*699cd480SApple OSS Distributionshas been suspended by a
593*699cd480SApple OSS Distributions.Dv STOP
594*699cd480SApple OSS Distributionscharacter.  If
595*699cd480SApple OSS Distributions.Dv IXON
596*699cd480SApple OSS Distributionsis set, the
597*699cd480SApple OSS Distributions.Dv START
598*699cd480SApple OSS Distributionscharacter is discarded when processed.
599*699cd480SApple OSS Distributions.Dv CR
600*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
601*699cd480SApple OSS Distributions.Dv ICANON
602*699cd480SApple OSS Distributionsflag is set; it is the
603*699cd480SApple OSS Distributions.Ql \&\er ,
604*699cd480SApple OSS Distributionsas denoted in the
605*699cd480SApple OSS Distributions.Tn \&C
606*699cd480SApple OSS DistributionsStandard {2}.  When
607*699cd480SApple OSS Distributions.Dv ICANON
608*699cd480SApple OSS Distributionsand
609*699cd480SApple OSS Distributions.Dv ICRNL
610*699cd480SApple OSS Distributionsare set and
611*699cd480SApple OSS Distributions.Dv IGNCR
612*699cd480SApple OSS Distributionsis not set, this character is translated into a
613*699cd480SApple OSS Distributions.Dv NL ,
614*699cd480SApple OSS Distributionsand
615*699cd480SApple OSS Distributionshas the same effect as a
616*699cd480SApple OSS Distributions.Dv NL
617*699cd480SApple OSS Distributionscharacter.
618*699cd480SApple OSS Distributions.El
619*699cd480SApple OSS Distributions.Pp
620*699cd480SApple OSS DistributionsThe following special characters are extensions defined by this
621*699cd480SApple OSS Distributionssystem and are not a part of 1003.1 termios.
622*699cd480SApple OSS Distributions.Bl -tag -width indent
623*699cd480SApple OSS Distributions.It Dv EOL2
624*699cd480SApple OSS DistributionsSecondary
625*699cd480SApple OSS Distributions.Dv EOL
626*699cd480SApple OSS Distributionscharacter.  Same function as
627*699cd480SApple OSS Distributions.Dv EOL.
628*699cd480SApple OSS Distributions.It Dv WERASE
629*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
630*699cd480SApple OSS Distributions.Dv ICANON
631*699cd480SApple OSS Distributionsflag is set.  Erases the last word in the current
632*699cd480SApple OSS Distributionsline according to one of two algorithms.  If the
633*699cd480SApple OSS Distributions.Dv ALTWERASE
634*699cd480SApple OSS Distributionsflag is not set, first any preceding whitespace is
635*699cd480SApple OSS Distributionserased, and then the maximal sequence of non-whitespace
636*699cd480SApple OSS Distributionscharacters.  If
637*699cd480SApple OSS Distributions.Dv ALTWERASE
638*699cd480SApple OSS Distributionsis set, first any preceding
639*699cd480SApple OSS Distributionswhitespace is erased, and then the maximal sequence
640*699cd480SApple OSS Distributionsof alphabetic/underscores or non alphabetic/underscores.
641*699cd480SApple OSS DistributionsAs a special case in this second algorithm, the first previous
642*699cd480SApple OSS Distributionsnon-whitespace character is skipped in determining
643*699cd480SApple OSS Distributionswhether the preceding word is a sequence of
644*699cd480SApple OSS Distributionsalphabetic/undercores.  This sounds confusing but turns
645*699cd480SApple OSS Distributionsout to be quite practical.
646*699cd480SApple OSS Distributions.It Dv REPRINT
647*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
648*699cd480SApple OSS Distributions.Dv ICANON
649*699cd480SApple OSS Distributionsflag is set.  Causes the current input edit line
650*699cd480SApple OSS Distributionsto be retyped.
651*699cd480SApple OSS Distributions.It Dv DSUSP
652*699cd480SApple OSS DistributionsHas similar actions to the
653*699cd480SApple OSS Distributions.Dv SUSP
654*699cd480SApple OSS Distributionscharacter, except that
655*699cd480SApple OSS Distributionsthe
656*699cd480SApple OSS Distributions.Dv SIGTSTP
657*699cd480SApple OSS Distributionssignal is delivered when one of the processes
658*699cd480SApple OSS Distributionsin the foreground process group issues a read() to the
659*699cd480SApple OSS Distributionscontrolling terminal.
660*699cd480SApple OSS Distributions.It Dv LNEXT
661*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
662*699cd480SApple OSS Distributions.Dv IEXTEN
663*699cd480SApple OSS Distributionsflag is set.  Receipt of this character causes the next
664*699cd480SApple OSS Distributionscharacter to be taken literally.
665*699cd480SApple OSS Distributions.It Dv DISCARD
666*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
667*699cd480SApple OSS Distributions.Dv IEXTEN
668*699cd480SApple OSS Distributionsflag is set.  Receipt of this character toggles the flushing
669*699cd480SApple OSS Distributionsof terminal output.
670*699cd480SApple OSS Distributions.It Dv STATUS
671*699cd480SApple OSS DistributionsSpecial character on input and is recognized if the
672*699cd480SApple OSS Distributions.Dv ICANON
673*699cd480SApple OSS Distributionsflag is set.  Receipt of this character causes a
674*699cd480SApple OSS Distributions.Dv SIGINFO
675*699cd480SApple OSS Distributionssignal to be sent to the foreground process group of the
676*699cd480SApple OSS Distributionsterminal.  Also, if the
677*699cd480SApple OSS Distributions.Dv NOKERNINFO
678*699cd480SApple OSS Distributionsflag is not set, it
679*699cd480SApple OSS Distributionscauses the kernel to write a status message to the terminal
680*699cd480SApple OSS Distributionsthat displays the current load average, the name of the
681*699cd480SApple OSS Distributionscommand in the foreground, its process ID, the symbolic
682*699cd480SApple OSS Distributionswait channel, the number of user and system seconds used,
683*699cd480SApple OSS Distributionsthe percentage of cpu the process is getting, and the resident
684*699cd480SApple OSS Distributionsset size of the process.
685*699cd480SApple OSS Distributions.El
686*699cd480SApple OSS Distributions.Pp
687*699cd480SApple OSS DistributionsThe
688*699cd480SApple OSS Distributions.Dv NL
689*699cd480SApple OSS Distributionsand
690*699cd480SApple OSS Distributions.Dv CR
691*699cd480SApple OSS Distributionscharacters cannot be changed.
692*699cd480SApple OSS DistributionsThe values for all the remaining characters can be set and are
693*699cd480SApple OSS Distributionsdescribed later in the document under
694*699cd480SApple OSS DistributionsSpecial Control Characters.
695*699cd480SApple OSS Distributions.Pp
696*699cd480SApple OSS DistributionsSpecial
697*699cd480SApple OSS Distributionscharacter functions associated with changeable special control characters
698*699cd480SApple OSS Distributionscan be disabled individually by setting their value to
699*699cd480SApple OSS Distributions.Dv {_POSIX_VDISABLE};
700*699cd480SApple OSS Distributionssee
701*699cd480SApple OSS Distributions.Sx "Special Control Characters" .
702*699cd480SApple OSS Distributions.Pp
703*699cd480SApple OSS DistributionsIf two or more special characters have the same value, the function
704*699cd480SApple OSS Distributionsperformed when that character is received is undefined.
705*699cd480SApple OSS Distributions.Ss Modem Disconnect
706*699cd480SApple OSS DistributionsIf a modem disconnect is detected by the terminal interface for a
707*699cd480SApple OSS Distributionscontrolling terminal, and if
708*699cd480SApple OSS Distributions.Dv CLOCAL
709*699cd480SApple OSS Distributionsis not set in the
710*699cd480SApple OSS Distributions.Fa c_cflag
711*699cd480SApple OSS Distributionsfield for
712*699cd480SApple OSS Distributionsthe terminal, the
713*699cd480SApple OSS Distributions.Dv SIGHUP
714*699cd480SApple OSS Distributionssignal is sent to the controlling
715*699cd480SApple OSS Distributionsprocess associated with the terminal.  Unless other arrangements have
716*699cd480SApple OSS Distributionsbeen made, this causes the controlling process to terminate.
717*699cd480SApple OSS DistributionsAny subsequent call to the read() function returns the value zero,
718*699cd480SApple OSS Distributionsindicating end of file.  Thus, processes that read a terminal
719*699cd480SApple OSS Distributionsfile and test for end-of-file can terminate appropriately after a
720*699cd480SApple OSS Distributionsdisconnect.
721*699cd480SApple OSS Distributions.\" If the
722*699cd480SApple OSS Distributions.\" .Er EIO
723*699cd480SApple OSS Distributions.\" condition specified in 6.1.1.4 that applies
724*699cd480SApple OSS Distributions.\" when the implementation supports job control also exists, it is
725*699cd480SApple OSS Distributions.\" unspecified whether the
726*699cd480SApple OSS Distributions.\" .Dv EOF
727*699cd480SApple OSS Distributions.\" condition or the
728*699cd480SApple OSS Distributions.\" .Pf [ Dv EIO
729*699cd480SApple OSS Distributions.\" ] is returned.
730*699cd480SApple OSS DistributionsAny
731*699cd480SApple OSS Distributionssubsequent write() to the terminal device returns -1, with
732*699cd480SApple OSS Distributions.Va errno
733*699cd480SApple OSS Distributionsset to
734*699cd480SApple OSS Distributions.Er EIO ,
735*699cd480SApple OSS Distributionsuntil the device is closed.
736*699cd480SApple OSS Distributions.Sh General Terminal Interface
737*699cd480SApple OSS Distributions.Pp
738*699cd480SApple OSS Distributions.Ss Closing a Terminal Device File
739*699cd480SApple OSS DistributionsThe last process to close a terminal device file causes any output
740*699cd480SApple OSS Distributionsto be sent to the device and any input to be discarded.  Then, if
741*699cd480SApple OSS Distributions.Dv HUPCL
742*699cd480SApple OSS Distributionsis set in the control modes, and the communications port supports a
743*699cd480SApple OSS Distributionsdisconnect function, the terminal device performs a disconnect.
744*699cd480SApple OSS Distributions.Ss Parameters That Can Be Set
745*699cd480SApple OSS DistributionsRoutines that need to control certain terminal
746*699cd480SApple OSS Distributions.Tn I/O
747*699cd480SApple OSS Distributionscharacteristics
748*699cd480SApple OSS Distributionsdo so by using the termios structure as defined in the header
749*699cd480SApple OSS Distributions.Aq Pa termios.h .
750*699cd480SApple OSS DistributionsThis structure contains minimally four scalar elements of bit flags
751*699cd480SApple OSS Distributionsand one array of special characters.  The scalar flag elements are
752*699cd480SApple OSS Distributionsnamed:
753*699cd480SApple OSS Distributions.Fa c_iflag ,
754*699cd480SApple OSS Distributions.Fa c_oflag ,
755*699cd480SApple OSS Distributions.Fa c_cflag ,
756*699cd480SApple OSS Distributionsand
757*699cd480SApple OSS Distributions.Fa c_lflag .
758*699cd480SApple OSS DistributionsThe character array is named
759*699cd480SApple OSS Distributions.Fa c_cc ,
760*699cd480SApple OSS Distributionsand its maximum index is
761*699cd480SApple OSS Distributions.Dv NCCS .
762*699cd480SApple OSS Distributions.Ss Input Modes
763*699cd480SApple OSS DistributionsValues of the
764*699cd480SApple OSS Distributions.Fa c_iflag
765*699cd480SApple OSS Distributionsfield describe the basic
766*699cd480SApple OSS Distributionsterminal input control, and are composed of
767*699cd480SApple OSS Distributionsfollowing masks:
768*699cd480SApple OSS Distributions.Pp
769*699cd480SApple OSS Distributions.Bl -tag -width IMAXBEL -offset indent -compact
770*699cd480SApple OSS Distributions.It Dv IGNBRK
771*699cd480SApple OSS Distributions/* ignore BREAK condition */
772*699cd480SApple OSS Distributions.It Dv BRKINT
773*699cd480SApple OSS Distributions/* map BREAK to SIGINTR */
774*699cd480SApple OSS Distributions.It Dv IGNPAR
775*699cd480SApple OSS Distributions/* ignore (discard) parity errors */
776*699cd480SApple OSS Distributions.It Dv PARMRK
777*699cd480SApple OSS Distributions/* mark parity and framing errors */
778*699cd480SApple OSS Distributions.It Dv INPCK
779*699cd480SApple OSS Distributions/* enable checking of parity errors */
780*699cd480SApple OSS Distributions.It Dv ISTRIP
781*699cd480SApple OSS Distributions/* strip 8th bit off chars */
782*699cd480SApple OSS Distributions.It Dv INLCR
783*699cd480SApple OSS Distributions/* map NL into CR */
784*699cd480SApple OSS Distributions.It Dv IGNCR
785*699cd480SApple OSS Distributions/* ignore CR */
786*699cd480SApple OSS Distributions.It Dv ICRNL
787*699cd480SApple OSS Distributions/* map CR to NL (ala CRMOD) */
788*699cd480SApple OSS Distributions.It Dv IXON
789*699cd480SApple OSS Distributions/* enable output flow control */
790*699cd480SApple OSS Distributions.It Dv IXOFF
791*699cd480SApple OSS Distributions/* enable input flow control */
792*699cd480SApple OSS Distributions.It Dv IXANY
793*699cd480SApple OSS Distributions/* any char will restart after stop */
794*699cd480SApple OSS Distributions.It Dv IMAXBEL
795*699cd480SApple OSS Distributions/* ring bell on input queue full */
796*699cd480SApple OSS Distributions.It Dv IUCLC
797*699cd480SApple OSS Distributions/* translate upper case to lower case */
798*699cd480SApple OSS Distributions.El
799*699cd480SApple OSS Distributions.Pp
800*699cd480SApple OSS DistributionsIn the context of asynchronous serial data transmission, a break
801*699cd480SApple OSS Distributionscondition is defined as a sequence of zero-valued bits that continues for
802*699cd480SApple OSS Distributionsmore than the time to send one byte.  The entire sequence of zero-valued
803*699cd480SApple OSS Distributionsbits is interpreted as a single break condition, even if it continues for
804*699cd480SApple OSS Distributionsa time equivalent to more than one byte.  In contexts other than
805*699cd480SApple OSS Distributionsasynchronous serial data transmission the definition of a break condition
806*699cd480SApple OSS Distributionsis implementation defined.
807*699cd480SApple OSS Distributions.Pp
808*699cd480SApple OSS DistributionsIf
809*699cd480SApple OSS Distributions.Dv IGNBRK
810*699cd480SApple OSS Distributionsis set, a break condition detected on input is ignored, that
811*699cd480SApple OSS Distributionsis, not put on the input queue and therefore not read by any process.  If
812*699cd480SApple OSS Distributions.Dv IGNBRK
813*699cd480SApple OSS Distributionsis not set and
814*699cd480SApple OSS Distributions.Dv BRKINT
815*699cd480SApple OSS Distributionsis set, the break condition flushes the
816*699cd480SApple OSS Distributionsinput and output queues and if the terminal is the controlling terminal
817*699cd480SApple OSS Distributionsof a foreground process group, the break condition generates a
818*699cd480SApple OSS Distributionssingle
819*699cd480SApple OSS Distributions.Dv SIGINT
820*699cd480SApple OSS Distributionssignal to that foreground process group.  If neither
821*699cd480SApple OSS Distributions.Dv IGNBRK
822*699cd480SApple OSS Distributionsnor
823*699cd480SApple OSS Distributions.Dv BRKINT
824*699cd480SApple OSS Distributionsis set, a break condition is read as a single
825*699cd480SApple OSS Distributions.Ql \&\e0 ,
826*699cd480SApple OSS Distributionsor if
827*699cd480SApple OSS Distributions.Dv PARMRK
828*699cd480SApple OSS Distributionsis set, as
829*699cd480SApple OSS Distributions.Ql \&\e377 ,
830*699cd480SApple OSS Distributions.Ql \&\e0 ,
831*699cd480SApple OSS Distributions.Ql \&\e0 .
832*699cd480SApple OSS Distributions.Pp
833*699cd480SApple OSS DistributionsIf
834*699cd480SApple OSS Distributions.Dv IGNPAR
835*699cd480SApple OSS Distributionsis set, a byte with a framing or parity error (other than
836*699cd480SApple OSS Distributionsbreak) is ignored.
837*699cd480SApple OSS Distributions.Pp
838*699cd480SApple OSS DistributionsIf
839*699cd480SApple OSS Distributions.Dv PARMRK
840*699cd480SApple OSS Distributionsis set, and
841*699cd480SApple OSS Distributions.Dv IGNPAR
842*699cd480SApple OSS Distributionsis not set, a byte with a framing or parity
843*699cd480SApple OSS Distributionserror (other than break) is given to the application as the
844*699cd480SApple OSS Distributionsthree-character sequence
845*699cd480SApple OSS Distributions.Ql \&\e377 ,
846*699cd480SApple OSS Distributions.Ql \&\e0 ,
847*699cd480SApple OSS DistributionsX, where
848*699cd480SApple OSS Distributions.Ql \&\e377 ,
849*699cd480SApple OSS Distributions.Ql \&\e0
850*699cd480SApple OSS Distributionsis a two-character
851*699cd480SApple OSS Distributionsflag preceding each sequence and X is the data of the character received
852*699cd480SApple OSS Distributionsin error.  To avoid ambiguity in this case, if
853*699cd480SApple OSS Distributions.Dv ISTRIP
854*699cd480SApple OSS Distributionsis not set, a valid
855*699cd480SApple OSS Distributionscharacter of
856*699cd480SApple OSS Distributions.Ql \&\e377
857*699cd480SApple OSS Distributionsis given to the application as
858*699cd480SApple OSS Distributions.Ql \&\e377 ,
859*699cd480SApple OSS Distributions.Ql \&\e377 .
860*699cd480SApple OSS DistributionsIf
861*699cd480SApple OSS Distributionsneither
862*699cd480SApple OSS Distributions.Dv PARMRK
863*699cd480SApple OSS Distributionsnor
864*699cd480SApple OSS Distributions.Dv IGNPAR
865*699cd480SApple OSS Distributionsis set, a framing or parity error (other than
866*699cd480SApple OSS Distributionsbreak) is given to the application as a single character
867*699cd480SApple OSS Distributions.Ql \&\e0 .
868*699cd480SApple OSS Distributions.Pp
869*699cd480SApple OSS DistributionsIf
870*699cd480SApple OSS Distributions.Dv INPCK
871*699cd480SApple OSS Distributionsis set, input parity checking is enabled.  If
872*699cd480SApple OSS Distributions.Dv INPCK
873*699cd480SApple OSS Distributionsis not set,
874*699cd480SApple OSS Distributionsinput parity checking is disabled, allowing output parity generation
875*699cd480SApple OSS Distributionswithout input parity errors.  Note that whether input parity checking is
876*699cd480SApple OSS Distributionsenabled or disabled is independent of whether parity detection is enabled
877*699cd480SApple OSS Distributionsor disabled (see
878*699cd480SApple OSS Distributions.Sx "Control Modes" ) .
879*699cd480SApple OSS DistributionsIf parity detection is enabled but input
880*699cd480SApple OSS Distributionsparity checking is disabled, the hardware to which the terminal is
881*699cd480SApple OSS Distributionsconnected recognizes the parity bit, but the terminal special file
882*699cd480SApple OSS Distributionsdoes not check whether this bit is set correctly or not.
883*699cd480SApple OSS Distributions.Pp
884*699cd480SApple OSS DistributionsIf
885*699cd480SApple OSS Distributions.Dv ISTRIP
886*699cd480SApple OSS Distributionsis set, valid input bytes are first stripped to seven bits,
887*699cd480SApple OSS Distributionsotherwise all eight bits are processed.
888*699cd480SApple OSS Distributions.Pp
889*699cd480SApple OSS DistributionsIf
890*699cd480SApple OSS Distributions.Dv INLCR
891*699cd480SApple OSS Distributionsis set, a received
892*699cd480SApple OSS Distributions.Dv NL
893*699cd480SApple OSS Distributionscharacter is translated into a
894*699cd480SApple OSS Distributions.Dv CR
895*699cd480SApple OSS Distributionscharacter.  If
896*699cd480SApple OSS Distributions.Dv IGNCR
897*699cd480SApple OSS Distributionsis set, a received
898*699cd480SApple OSS Distributions.Dv CR
899*699cd480SApple OSS Distributionscharacter is ignored (not
900*699cd480SApple OSS Distributionsread).  If
901*699cd480SApple OSS Distributions.Dv IGNCR
902*699cd480SApple OSS Distributionsis not set and
903*699cd480SApple OSS Distributions.Dv ICRNL
904*699cd480SApple OSS Distributionsis set, a received
905*699cd480SApple OSS Distributions.Dv CR
906*699cd480SApple OSS Distributionscharacter is
907*699cd480SApple OSS Distributionstranslated into a
908*699cd480SApple OSS Distributions.Dv NL
909*699cd480SApple OSS Distributionscharacter.
910*699cd480SApple OSS Distributions.Pp
911*699cd480SApple OSS DistributionsIf
912*699cd480SApple OSS Distributions.Dv IXON
913*699cd480SApple OSS Distributionsis set, start/stop output control is enabled.  A received
914*699cd480SApple OSS Distributions.Dv STOP
915*699cd480SApple OSS Distributionscharacter suspends output and a received
916*699cd480SApple OSS Distributions.Dv START
917*699cd480SApple OSS Distributionscharacter
918*699cd480SApple OSS Distributionsrestarts output. If
919*699cd480SApple OSS Distributions.Dv IXANY
920*699cd480SApple OSS Distributionsis also set, then any character may
921*699cd480SApple OSS Distributionsrestart output. When
922*699cd480SApple OSS Distributions.Dv IXON
923*699cd480SApple OSS Distributionsis set,
924*699cd480SApple OSS Distributions.Dv START
925*699cd480SApple OSS Distributionsand
926*699cd480SApple OSS Distributions.Dv STOP
927*699cd480SApple OSS Distributionscharacters are not
928*699cd480SApple OSS Distributionsread, but merely perform flow control functions.  When
929*699cd480SApple OSS Distributions.Dv IXON
930*699cd480SApple OSS Distributionsis not set,
931*699cd480SApple OSS Distributionsthe
932*699cd480SApple OSS Distributions.Dv START
933*699cd480SApple OSS Distributionsand
934*699cd480SApple OSS Distributions.Dv STOP
935*699cd480SApple OSS Distributionscharacters are read.
936*699cd480SApple OSS Distributions.Pp
937*699cd480SApple OSS DistributionsIf
938*699cd480SApple OSS Distributions.Dv IXOFF
939*699cd480SApple OSS Distributionsis set, start/stop input control is enabled.  The system shall
940*699cd480SApple OSS Distributionstransmit one or more
941*699cd480SApple OSS Distributions.Dv STOP
942*699cd480SApple OSS Distributionscharacters, which are intended to cause the
943*699cd480SApple OSS Distributionsterminal device to stop transmitting data, as needed to prevent the input
944*699cd480SApple OSS Distributionsqueue from overflowing and causing the undefined behavior described in
945*699cd480SApple OSS Distributions.Sx "Input Processing and Reading Data" ,
946*699cd480SApple OSS Distributionsand shall transmit one or more
947*699cd480SApple OSS Distributions.Dv START
948*699cd480SApple OSS Distributionscharacters, which are
949*699cd480SApple OSS Distributionsintended to cause the terminal device to resume transmitting data, as
950*699cd480SApple OSS Distributionssoon as the device can continue transmitting data without risk of
951*699cd480SApple OSS Distributionsoverflowing the input queue.  The precise conditions under which
952*699cd480SApple OSS Distributions.Dv STOP
953*699cd480SApple OSS Distributionsand
954*699cd480SApple OSS DistributionsSTART
955*699cd480SApple OSS Distributionscharacters are transmitted are implementation defined.
956*699cd480SApple OSS Distributions.Pp
957*699cd480SApple OSS DistributionsIf
958*699cd480SApple OSS Distributions.Dv IMAXBEL
959*699cd480SApple OSS Distributionsis set and the input queue is full, subsequent input shall cause an
960*699cd480SApple OSS Distributions.Tn ASCII
961*699cd480SApple OSS Distributions.Dv BEL
962*699cd480SApple OSS Distributionscharacter to be transmitted to
963*699cd480SApple OSS Distributionsthe output queue.
964*699cd480SApple OSS Distributions.Pp
965*699cd480SApple OSS DistributionsIf
966*699cd480SApple OSS Distributions.Dv IUCLC
967*699cd480SApple OSS Distributionsis set, characters will be translated from upper to lower case on
968*699cd480SApple OSS Distributionsinput.
969*699cd480SApple OSS Distributions.Pp
970*699cd480SApple OSS DistributionsThe initial input control value after open() is implementation defined.
971*699cd480SApple OSS Distributions.Ss Output Modes
972*699cd480SApple OSS DistributionsValues of the
973*699cd480SApple OSS Distributions.Fa c_oflag
974*699cd480SApple OSS Distributionsfield describe the basic terminal output control,
975*699cd480SApple OSS Distributionsand are composed of the following masks:
976*699cd480SApple OSS Distributions.Pp
977*699cd480SApple OSS Distributions.Bl -tag -width OXTABS -offset indent -compact
978*699cd480SApple OSS Distributions.It Dv OPOST
979*699cd480SApple OSS Distributions/* enable following output processing */
980*699cd480SApple OSS Distributions.It Dv ONLCR
981*699cd480SApple OSS Distributions/* map NL to CR-NL (ala
982*699cd480SApple OSS Distributions.Dv CRMOD)
983*699cd480SApple OSS Distributions*/
984*699cd480SApple OSS Distributions.It Dv OXTABS
985*699cd480SApple OSS Distributions/* expand tabs to spaces */
986*699cd480SApple OSS Distributions.It Dv ONOEOT
987*699cd480SApple OSS Distributions/* discard
988*699cd480SApple OSS Distributions.Dv EOT Ns 's
989*699cd480SApple OSS Distributions.Ql \&^D
990*699cd480SApple OSS Distributionson output) */
991*699cd480SApple OSS Distributions.It Dv OCRNL
992*699cd480SApple OSS Distributions/* map CR to NL */
993*699cd480SApple OSS Distributions.It Dv OLCUC
994*699cd480SApple OSS Distributions/* translate lower case to upper case */
995*699cd480SApple OSS Distributions.It Dv ONOCR
996*699cd480SApple OSS Distributions/* No CR output at column 0 */
997*699cd480SApple OSS Distributions.It Dv ONLRET
998*699cd480SApple OSS Distributions/* NL performs CR function */
999*699cd480SApple OSS Distributions.El
1000*699cd480SApple OSS Distributions.Pp
1001*699cd480SApple OSS DistributionsIf
1002*699cd480SApple OSS Distributions.Dv OPOST
1003*699cd480SApple OSS Distributionsis set, the remaining flag masks are interpreted as follows;
1004*699cd480SApple OSS Distributionsotherwise characters are transmitted without change.
1005*699cd480SApple OSS Distributions.Pp
1006*699cd480SApple OSS DistributionsIf
1007*699cd480SApple OSS Distributions.Dv ONLCR
1008*699cd480SApple OSS Distributionsis set, newlines are translated to carriage return, linefeeds.
1009*699cd480SApple OSS Distributions.Pp
1010*699cd480SApple OSS DistributionsIf
1011*699cd480SApple OSS Distributions.Dv OXTABS
1012*699cd480SApple OSS Distributionsis set, tabs are expanded to the appropriate number of
1013*699cd480SApple OSS Distributionsspaces (assuming 8 column tab stops).
1014*699cd480SApple OSS Distributions.Pp
1015*699cd480SApple OSS DistributionsIf
1016*699cd480SApple OSS Distributions.Dv ONOEOT
1017*699cd480SApple OSS Distributionsis set,
1018*699cd480SApple OSS Distributions.Tn ASCII
1019*699cd480SApple OSS Distributions.Dv EOT NS 's
1020*699cd480SApple OSS Distributionsare discarded on output.
1021*699cd480SApple OSS Distributions.Pp
1022*699cd480SApple OSS DistributionsIf
1023*699cd480SApple OSS Distributions.Dv OCRNL
1024*699cd480SApple OSS Distributionsis set, carriage returns are translated to newlines.
1025*699cd480SApple OSS Distributions.Pp
1026*699cd480SApple OSS DistributionsIf
1027*699cd480SApple OSS Distributions.Dv OLCUC
1028*699cd480SApple OSS Distributionsis set, lower case is translated to upper case on output.
1029*699cd480SApple OSS Distributions.Pp
1030*699cd480SApple OSS DistributionsIf
1031*699cd480SApple OSS Distributions.Dv ONOCR
1032*699cd480SApple OSS Distributionsis set, no CR character is output when at column 0.
1033*699cd480SApple OSS Distributions.Pp
1034*699cd480SApple OSS DistributionsIf
1035*699cd480SApple OSS Distributions.Dv ONLRET
1036*699cd480SApple OSS Distributionsis set, NL also performs CR on output, and reset current
1037*699cd480SApple OSS Distributionscolumn to 0.
1038*699cd480SApple OSS Distributions.Ss Control Modes
1039*699cd480SApple OSS DistributionsValues of the
1040*699cd480SApple OSS Distributions.Fa c_cflag
1041*699cd480SApple OSS Distributionsfield describe the basic
1042*699cd480SApple OSS Distributionsterminal hardware control, and are composed of the
1043*699cd480SApple OSS Distributionsfollowing masks.
1044*699cd480SApple OSS DistributionsNot all values
1045*699cd480SApple OSS Distributionsspecified are supported by all hardware.
1046*699cd480SApple OSS Distributions.Pp
1047*699cd480SApple OSS Distributions.Bl -tag -width CRTSXIFLOW -offset indent -compact
1048*699cd480SApple OSS Distributions.It Dv CSIZE
1049*699cd480SApple OSS Distributions/* character size mask */
1050*699cd480SApple OSS Distributions.It Dv CS5
1051*699cd480SApple OSS Distributions/* 5 bits (pseudo) */
1052*699cd480SApple OSS Distributions.It Dv CS6
1053*699cd480SApple OSS Distributions/* 6 bits */
1054*699cd480SApple OSS Distributions.It Dv CS7
1055*699cd480SApple OSS Distributions/* 7 bits */
1056*699cd480SApple OSS Distributions.It Dv CS8
1057*699cd480SApple OSS Distributions/* 8 bits */
1058*699cd480SApple OSS Distributions.It Dv CSTOPB
1059*699cd480SApple OSS Distributions/* send 2 stop bits */
1060*699cd480SApple OSS Distributions.It Dv CREAD
1061*699cd480SApple OSS Distributions/* enable receiver */
1062*699cd480SApple OSS Distributions.It Dv PARENB
1063*699cd480SApple OSS Distributions/* parity enable */
1064*699cd480SApple OSS Distributions.It Dv PARODD
1065*699cd480SApple OSS Distributions/* odd parity, else even */
1066*699cd480SApple OSS Distributions.It Dv HUPCL
1067*699cd480SApple OSS Distributions/* hang up on last close */
1068*699cd480SApple OSS Distributions.It Dv CLOCAL
1069*699cd480SApple OSS Distributions/* ignore modem status lines */
1070*699cd480SApple OSS Distributions.It Dv CCTS_OFLOW
1071*699cd480SApple OSS Distributions/*
1072*699cd480SApple OSS Distributions.Dv CTS
1073*699cd480SApple OSS Distributionsflow control of output */
1074*699cd480SApple OSS Distributions.It Dv CRTSCTS
1075*699cd480SApple OSS Distributions/* same as
1076*699cd480SApple OSS Distributions.Dv CCTS_OFLOW
1077*699cd480SApple OSS Distributions*/
1078*699cd480SApple OSS Distributions.It Dv CRTS_IFLOW
1079*699cd480SApple OSS Distributions/* RTS flow control of input */
1080*699cd480SApple OSS Distributions.It Dv MDMBUF
1081*699cd480SApple OSS Distributions/* flow control output via Carrier */
1082*699cd480SApple OSS Distributions.El
1083*699cd480SApple OSS Distributions.Pp
1084*699cd480SApple OSS DistributionsThe
1085*699cd480SApple OSS Distributions.Dv CSIZE
1086*699cd480SApple OSS Distributionsbits specify the byte size in bits for both transmission and
1087*699cd480SApple OSS Distributionsreception.  The
1088*699cd480SApple OSS Distributions.Fa c_cflag
1089*699cd480SApple OSS Distributionsis masked with
1090*699cd480SApple OSS Distributions.Dv CSIZE
1091*699cd480SApple OSS Distributionsand compared with the
1092*699cd480SApple OSS Distributionsvalues
1093*699cd480SApple OSS Distributions.Dv CS5 ,
1094*699cd480SApple OSS Distributions.Dv CS6 ,
1095*699cd480SApple OSS Distributions.Dv CS7 ,
1096*699cd480SApple OSS Distributionsor
1097*699cd480SApple OSS Distributions.Dv CS8 .
1098*699cd480SApple OSS DistributionsThis size does not include the parity bit, if any.  If
1099*699cd480SApple OSS Distributions.Dv CSTOPB
1100*699cd480SApple OSS Distributionsis set, two stop bits are used, otherwise one stop bit.  For example, at
1101*699cd480SApple OSS Distributions110 baud, two stop bits are normally used.
1102*699cd480SApple OSS Distributions.Pp
1103*699cd480SApple OSS DistributionsIf
1104*699cd480SApple OSS Distributions.Dv CREAD
1105*699cd480SApple OSS Distributionsis set, the receiver is enabled.  Otherwise, no character is
1106*699cd480SApple OSS Distributionsreceived.
1107*699cd480SApple OSS DistributionsNot all hardware supports this bit.  In fact, this flag
1108*699cd480SApple OSS Distributionsis pretty silly and if it were not part of the
1109*699cd480SApple OSS Distributions.Nm termios
1110*699cd480SApple OSS Distributionsspecification
1111*699cd480SApple OSS Distributionsit would be omitted.
1112*699cd480SApple OSS Distributions.Pp
1113*699cd480SApple OSS DistributionsIf
1114*699cd480SApple OSS Distributions.Dv PARENB
1115*699cd480SApple OSS Distributionsis set, parity generation and detection are enabled and a parity
1116*699cd480SApple OSS Distributionsbit is added to each character.  If parity is enabled,
1117*699cd480SApple OSS Distributions.Dv PARODD
1118*699cd480SApple OSS Distributionsspecifies
1119*699cd480SApple OSS Distributionsodd parity if set, otherwise even parity is used.
1120*699cd480SApple OSS Distributions.Pp
1121*699cd480SApple OSS DistributionsIf
1122*699cd480SApple OSS Distributions.Dv HUPCL
1123*699cd480SApple OSS Distributionsis set, the modem control lines for the port are lowered
1124*699cd480SApple OSS Distributionswhen the last process with the port open closes the port or the process
1125*699cd480SApple OSS Distributionsterminates.  The modem connection is broken.
1126*699cd480SApple OSS Distributions.Pp
1127*699cd480SApple OSS DistributionsIf
1128*699cd480SApple OSS Distributions.Dv CLOCAL
1129*699cd480SApple OSS Distributionsis set, a connection does not depend on the state of the modem
1130*699cd480SApple OSS Distributionsstatus lines.  If
1131*699cd480SApple OSS Distributions.Dv CLOCAL
1132*699cd480SApple OSS Distributionsis clear, the modem status lines are
1133*699cd480SApple OSS Distributionsmonitored.
1134*699cd480SApple OSS Distributions.Pp
1135*699cd480SApple OSS DistributionsUnder normal circumstances, a call to the open() function waits for
1136*699cd480SApple OSS Distributionsthe modem connection to complete.  However, if the
1137*699cd480SApple OSS Distributions.Dv O_NONBLOCK
1138*699cd480SApple OSS Distributionsflag is set
1139*699cd480SApple OSS Distributionsor if
1140*699cd480SApple OSS Distributions.Dv CLOCAL
1141*699cd480SApple OSS Distributionshas been set, the open() function returns
1142*699cd480SApple OSS Distributionsimmediately without waiting for the connection.
1143*699cd480SApple OSS Distributions.Pp
1144*699cd480SApple OSS DistributionsThe
1145*699cd480SApple OSS Distributions.Dv CCTS_OFLOW
1146*699cd480SApple OSS Distributions.Pf ( Dv CRTSCTS )
1147*699cd480SApple OSS Distributionsflag is currently unused.
1148*699cd480SApple OSS Distributions.Pp
1149*699cd480SApple OSS DistributionsIf
1150*699cd480SApple OSS Distributions.Dv MDMBUF
1151*699cd480SApple OSS Distributionsis set then output flow control is controlled by the state
1152*699cd480SApple OSS Distributionsof Carrier Detect.
1153*699cd480SApple OSS Distributions.Pp
1154*699cd480SApple OSS DistributionsIf the object for which the control modes are set is not an asynchronous
1155*699cd480SApple OSS Distributionsserial connection, some of the modes may be ignored; for example, if an
1156*699cd480SApple OSS Distributionsattempt is made to set the baud rate on a network connection to a
1157*699cd480SApple OSS Distributionsterminal on another host, the baud rate may or may not be set on the
1158*699cd480SApple OSS Distributionsconnection between that terminal and the machine it is directly connected
1159*699cd480SApple OSS Distributionsto.
1160*699cd480SApple OSS Distributions.Ss Local Modes
1161*699cd480SApple OSS DistributionsValues of the
1162*699cd480SApple OSS Distributions.Fa c_lflag
1163*699cd480SApple OSS Distributionsfield describe the control of
1164*699cd480SApple OSS Distributionsvarious functions, and are composed of the following
1165*699cd480SApple OSS Distributionsmasks.
1166*699cd480SApple OSS Distributions.Pp
1167*699cd480SApple OSS Distributions.Bl -tag -width NOKERNINFO -offset indent -compact
1168*699cd480SApple OSS Distributions.It Dv ECHOKE
1169*699cd480SApple OSS Distributions/* visual erase for line kill */
1170*699cd480SApple OSS Distributions.It Dv ECHOE
1171*699cd480SApple OSS Distributions/* visually erase chars */
1172*699cd480SApple OSS Distributions.It Dv ECHO
1173*699cd480SApple OSS Distributions/* enable echoing */
1174*699cd480SApple OSS Distributions.It Dv ECHONL
1175*699cd480SApple OSS Distributions/* echo
1176*699cd480SApple OSS Distributions.Dv NL
1177*699cd480SApple OSS Distributionseven if
1178*699cd480SApple OSS Distributions.Dv ECHO
1179*699cd480SApple OSS Distributionsis off */
1180*699cd480SApple OSS Distributions.It Dv ECHOPRT
1181*699cd480SApple OSS Distributions/* visual erase mode for hardcopy */
1182*699cd480SApple OSS Distributions.It Dv ECHOCTL
1183*699cd480SApple OSS Distributions/* echo control chars as ^(Char) */
1184*699cd480SApple OSS Distributions.It Dv ISIG
1185*699cd480SApple OSS Distributions/* enable signals
1186*699cd480SApple OSS Distributions.Dv INTR ,
1187*699cd480SApple OSS Distributions.Dv QUIT ,
1188*699cd480SApple OSS Distributions.Dv [D]SUSP
1189*699cd480SApple OSS Distributions*/
1190*699cd480SApple OSS Distributions.It Dv ICANON
1191*699cd480SApple OSS Distributions/* canonicalize input lines */
1192*699cd480SApple OSS Distributions.It Dv ALTWERASE
1193*699cd480SApple OSS Distributions/* use alternate
1194*699cd480SApple OSS Distributions.Dv WERASE
1195*699cd480SApple OSS Distributionsalgorithm */
1196*699cd480SApple OSS Distributions.It Dv IEXTEN
1197*699cd480SApple OSS Distributions/* enable
1198*699cd480SApple OSS Distributions.Dv DISCARD
1199*699cd480SApple OSS Distributionsand
1200*699cd480SApple OSS Distributions.Dv LNEXT
1201*699cd480SApple OSS Distributions*/
1202*699cd480SApple OSS Distributions.It Dv EXTPROC
1203*699cd480SApple OSS Distributions/* external processing */
1204*699cd480SApple OSS Distributions.It Dv TOSTOP
1205*699cd480SApple OSS Distributions/* stop background jobs from output */
1206*699cd480SApple OSS Distributions.It Dv FLUSHO
1207*699cd480SApple OSS Distributions/* output being flushed (state) */
1208*699cd480SApple OSS Distributions.It Dv NOKERNINFO
1209*699cd480SApple OSS Distributions/* no kernel output from
1210*699cd480SApple OSS Distributions.Dv VSTATUS
1211*699cd480SApple OSS Distributions*/
1212*699cd480SApple OSS Distributions.It Dv PENDIN
1213*699cd480SApple OSS Distributions/* XXX retype pending input (state) */
1214*699cd480SApple OSS Distributions.It Dv NOFLSH
1215*699cd480SApple OSS Distributions/* don't flush after interrupt */
1216*699cd480SApple OSS Distributions.El
1217*699cd480SApple OSS Distributions.Pp
1218*699cd480SApple OSS DistributionsIf
1219*699cd480SApple OSS Distributions.Dv ECHO
1220*699cd480SApple OSS Distributionsis set, input characters are echoed back to the terminal.  If
1221*699cd480SApple OSS Distributions.Dv ECHO
1222*699cd480SApple OSS Distributionsis not set, input characters are not echoed.
1223*699cd480SApple OSS Distributions.Pp
1224*699cd480SApple OSS DistributionsIf
1225*699cd480SApple OSS Distributions.Dv ECHOE
1226*699cd480SApple OSS Distributionsand
1227*699cd480SApple OSS Distributions.Dv ICANON
1228*699cd480SApple OSS Distributionsare set, the
1229*699cd480SApple OSS Distributions.Dv ERASE
1230*699cd480SApple OSS Distributionscharacter causes the terminal
1231*699cd480SApple OSS Distributionsto erase the last character in the current line from the display, if
1232*699cd480SApple OSS Distributionspossible.  If there is no character to erase, an implementation may echo
1233*699cd480SApple OSS Distributionsan indication that this was the case or do nothing.
1234*699cd480SApple OSS Distributions.Pp
1235*699cd480SApple OSS DistributionsIf
1236*699cd480SApple OSS Distributions.Dv ECHOK
1237*699cd480SApple OSS Distributionsand
1238*699cd480SApple OSS Distributions.Dv ICANON
1239*699cd480SApple OSS Distributionsare set, the
1240*699cd480SApple OSS Distributions.Dv KILL
1241*699cd480SApple OSS Distributionscharacter causes
1242*699cd480SApple OSS Distributionsthe current line to be discarded and the system echoes the
1243*699cd480SApple OSS Distributions.Ql \&\en
1244*699cd480SApple OSS Distributionscharacter after the
1245*699cd480SApple OSS Distributions.Dv KILL
1246*699cd480SApple OSS Distributionscharacter.
1247*699cd480SApple OSS Distributions.Pp
1248*699cd480SApple OSS DistributionsIf
1249*699cd480SApple OSS Distributions.Dv ECHOKE
1250*699cd480SApple OSS Distributionsand
1251*699cd480SApple OSS Distributions.Dv ICANON
1252*699cd480SApple OSS Distributionsare set, the
1253*699cd480SApple OSS Distributions.Dv KILL
1254*699cd480SApple OSS Distributionscharacter causes
1255*699cd480SApple OSS Distributionsthe current line to be discarded and the system causes
1256*699cd480SApple OSS Distributionsthe terminal
1257*699cd480SApple OSS Distributionsto erase the line from the display.
1258*699cd480SApple OSS Distributions.Pp
1259*699cd480SApple OSS DistributionsIf
1260*699cd480SApple OSS Distributions.Dv ECHOPRT
1261*699cd480SApple OSS Distributionsand
1262*699cd480SApple OSS Distributions.Dv ICANON
1263*699cd480SApple OSS Distributionsare set, the system assumes
1264*699cd480SApple OSS Distributionsthat the display is a printing device and prints a
1265*699cd480SApple OSS Distributionsbackslash and the erased characters when processing
1266*699cd480SApple OSS Distributions.Dv ERASE
1267*699cd480SApple OSS Distributionscharacters, followed by a forward slash.
1268*699cd480SApple OSS Distributions.Pp
1269*699cd480SApple OSS DistributionsIf
1270*699cd480SApple OSS Distributions.Dv ECHOCTL
1271*699cd480SApple OSS Distributionsis set, the system echoes control characters
1272*699cd480SApple OSS Distributionsin a visible fashion using a caret followed by the control character.
1273*699cd480SApple OSS Distributions.Pp
1274*699cd480SApple OSS DistributionsIf
1275*699cd480SApple OSS Distributions.Dv ALTWERASE
1276*699cd480SApple OSS Distributionsis set, the system uses an alternative algorithm
1277*699cd480SApple OSS Distributionsfor determining what constitutes a word when processing
1278*699cd480SApple OSS Distributions.Dv WERASE
1279*699cd480SApple OSS Distributionscharacters (see
1280*699cd480SApple OSS Distributions.Dv WERASE ) .
1281*699cd480SApple OSS Distributions.Pp
1282*699cd480SApple OSS DistributionsIf
1283*699cd480SApple OSS Distributions.Dv ECHONL
1284*699cd480SApple OSS Distributionsand
1285*699cd480SApple OSS Distributions.Dv ICANON
1286*699cd480SApple OSS Distributionsare set, the
1287*699cd480SApple OSS Distributions.Ql \&\en
1288*699cd480SApple OSS Distributionscharacter echoes even if
1289*699cd480SApple OSS Distributions.Dv ECHO
1290*699cd480SApple OSS Distributionsis not set.
1291*699cd480SApple OSS Distributions.Pp
1292*699cd480SApple OSS DistributionsIf
1293*699cd480SApple OSS Distributions.Dv ICANON
1294*699cd480SApple OSS Distributionsis set, canonical processing is enabled.  This enables the
1295*699cd480SApple OSS Distributionserase and kill edit functions, and the assembly of input characters into
1296*699cd480SApple OSS Distributionslines delimited by
1297*699cd480SApple OSS Distributions.Dv NL,
1298*699cd480SApple OSS Distributions.Dv EOF ,
1299*699cd480SApple OSS Distributionsand
1300*699cd480SApple OSS Distributions.Dv EOL,
1301*699cd480SApple OSS Distributionsas described in
1302*699cd480SApple OSS Distributions.Sx "Canonical Mode Input Processing" .
1303*699cd480SApple OSS Distributions.Pp
1304*699cd480SApple OSS DistributionsIf
1305*699cd480SApple OSS Distributions.Dv ICANON
1306*699cd480SApple OSS Distributionsis not set, read requests are satisfied directly from the input
1307*699cd480SApple OSS Distributionsqueue.  A read is not satisfied until at least
1308*699cd480SApple OSS Distributions.Dv MIN
1309*699cd480SApple OSS Distributionsbytes have been
1310*699cd480SApple OSS Distributionsreceived or the timeout value
1311*699cd480SApple OSS Distributions.Dv TIME
1312*699cd480SApple OSS Distributionsexpired between bytes.  The time value
1313*699cd480SApple OSS Distributionsrepresents tenths of seconds.  See
1314*699cd480SApple OSS Distributions.Sx "Noncanonical Mode Input Processing"
1315*699cd480SApple OSS Distributionsfor more details.
1316*699cd480SApple OSS Distributions.Pp
1317*699cd480SApple OSS DistributionsIf
1318*699cd480SApple OSS Distributions.Dv ISIG
1319*699cd480SApple OSS Distributionsis set, each input character is checked against the special
1320*699cd480SApple OSS Distributionscontrol characters
1321*699cd480SApple OSS Distributions.Dv INTR ,
1322*699cd480SApple OSS Distributions.Dv QUIT ,
1323*699cd480SApple OSS Distributionsand
1324*699cd480SApple OSS Distributions.Dv SUSP
1325*699cd480SApple OSS Distributions(job control only).  If an input
1326*699cd480SApple OSS Distributionscharacter matches one of these control characters, the function
1327*699cd480SApple OSS Distributionsassociated with that character is performed.  If
1328*699cd480SApple OSS Distributions.Dv ISIG
1329*699cd480SApple OSS Distributionsis not set, no
1330*699cd480SApple OSS Distributionschecking is done.  Thus these special input functions are possible only
1331*699cd480SApple OSS Distributionsif
1332*699cd480SApple OSS Distributions.Dv ISIG
1333*699cd480SApple OSS Distributionsis set.
1334*699cd480SApple OSS Distributions.Pp
1335*699cd480SApple OSS DistributionsIf
1336*699cd480SApple OSS Distributions.Dv IEXTEN
1337*699cd480SApple OSS Distributionsis set, implementation-defined functions are recognized
1338*699cd480SApple OSS Distributionsfrom the input data.  How
1339*699cd480SApple OSS Distributions.Dv IEXTEN
1340*699cd480SApple OSS Distributionsbeing set
1341*699cd480SApple OSS Distributionsinteracts with
1342*699cd480SApple OSS Distributions.Dv ICANON ,
1343*699cd480SApple OSS Distributions.Dv ISIG ,
1344*699cd480SApple OSS Distributions.Dv IXON ,
1345*699cd480SApple OSS Distributionsor
1346*699cd480SApple OSS Distributions.Dv IXOFF
1347*699cd480SApple OSS Distributionsis implementation defined.
1348*699cd480SApple OSS DistributionsIf
1349*699cd480SApple OSS Distributions.Dv IEXTEN
1350*699cd480SApple OSS Distributionsis not set, then
1351*699cd480SApple OSS Distributionsimplementation-defined functions are not recognized, and the
1352*699cd480SApple OSS Distributionscorresponding input characters are not processed as described for
1353*699cd480SApple OSS Distributions.Dv ICANON ,
1354*699cd480SApple OSS Distributions.Dv ISIG ,
1355*699cd480SApple OSS Distributions.Dv IXON ,
1356*699cd480SApple OSS Distributionsand
1357*699cd480SApple OSS Distributions.Dv IXOFF .
1358*699cd480SApple OSS Distributions.Pp
1359*699cd480SApple OSS DistributionsIf
1360*699cd480SApple OSS Distributions.Dv NOFLSH
1361*699cd480SApple OSS Distributionsis set, the normal flush of the input and output queues
1362*699cd480SApple OSS Distributionsassociated with the
1363*699cd480SApple OSS Distributions.Dv INTR ,
1364*699cd480SApple OSS Distributions.Dv QUIT ,
1365*699cd480SApple OSS Distributionsand
1366*699cd480SApple OSS Distributions.Dv SUSP
1367*699cd480SApple OSS Distributionscharacters
1368*699cd480SApple OSS Distributionsare not be done.
1369*699cd480SApple OSS Distributions.Pp
1370*699cd480SApple OSS DistributionsIf
1371*699cd480SApple OSS Distributions.Dv ICANON
1372*699cd480SApple OSS Distributionsis set, an upper case character is preserved on input if prefixed by
1373*699cd480SApple OSS Distributionsa \\ character.  In addition, this prefix is added to upper case
1374*699cd480SApple OSS Distributionscharacters on output.
1375*699cd480SApple OSS Distributions.Pp
1376*699cd480SApple OSS DistributionsIn addition, the following special character translations are in effect:
1377*699cd480SApple OSS Distributions.Pp
1378*699cd480SApple OSS Distributions.Bl -column "for:" "use:" -offset indent -compact
1379*699cd480SApple OSS Distributions.It Em "for:    use:"
1380*699cd480SApple OSS Distributions.It Dv ` Ta \&\e'
1381*699cd480SApple OSS Distributions.It Dv | Ta \&\e!
1382*699cd480SApple OSS Distributions.It Dv ~ Ta \&\e^
1383*699cd480SApple OSS Distributions.It Dv { Ta \&\e(
1384*699cd480SApple OSS Distributions.It Dv } Ta \&\e)
1385*699cd480SApple OSS Distributions.It Dv \&\e Ta \&\e\e
1386*699cd480SApple OSS Distributions.El
1387*699cd480SApple OSS Distributions.Pp
1388*699cd480SApple OSS DistributionsIf
1389*699cd480SApple OSS Distributions.Dv TOSTOP
1390*699cd480SApple OSS Distributionsis set, the signal
1391*699cd480SApple OSS Distributions.Dv SIGTTOU
1392*699cd480SApple OSS Distributionsis sent to the process group of a process that tries to write to
1393*699cd480SApple OSS Distributionsits controlling terminal if it is not in the foreground process group for
1394*699cd480SApple OSS Distributionsthat terminal.  This signal, by default, stops the members of the process
1395*699cd480SApple OSS Distributionsgroup.  Otherwise, the output generated by that process is output to the
1396*699cd480SApple OSS Distributionscurrent output stream.  Processes that are blocking or ignoring
1397*699cd480SApple OSS Distributions.Dv SIGTTOU
1398*699cd480SApple OSS Distributionssignals are excepted and allowed to produce output and the
1399*699cd480SApple OSS Distributions.Dv SIGTTOU
1400*699cd480SApple OSS Distributionssignal
1401*699cd480SApple OSS Distributionsis not sent.
1402*699cd480SApple OSS Distributions.Pp
1403*699cd480SApple OSS DistributionsIf
1404*699cd480SApple OSS Distributions.Dv NOKERNINFO
1405*699cd480SApple OSS Distributionsis set, the kernel does not produce a status message
1406*699cd480SApple OSS Distributionswhen processing
1407*699cd480SApple OSS Distributions.Dv STATUS
1408*699cd480SApple OSS Distributionscharacters (see
1409*699cd480SApple OSS Distributions.Dv STATUS ) .
1410*699cd480SApple OSS Distributions.Ss Special Control Characters
1411*699cd480SApple OSS DistributionsThe special control characters values are defined by the array
1412*699cd480SApple OSS Distributions.Fa c_cc .
1413*699cd480SApple OSS DistributionsThis table lists the array index, the corresponding special character,
1414*699cd480SApple OSS Distributionsand the system default value.  For an accurate list of
1415*699cd480SApple OSS Distributionsthe system defaults, consult the header file
1416*699cd480SApple OSS Distributions.Aq Pa ttydefaults.h .
1417*699cd480SApple OSS Distributions.Pp
1418*699cd480SApple OSS Distributions.Bl -column "Index Name" "Special Character" -offset indent -compact
1419*699cd480SApple OSS Distributions.It Em "Index Name	Special Character	Default Value"
1420*699cd480SApple OSS Distributions.It Dv VEOF Ta EOF Ta \&^D
1421*699cd480SApple OSS Distributions.It Dv VEOL Ta EOL Ta _POSIX_VDISABLE
1422*699cd480SApple OSS Distributions.It Dv VEOL2 Ta EOL2 Ta _POSIX_VDISABLE
1423*699cd480SApple OSS Distributions.It Dv VERASE Ta ERASE Ta \&^? Ql \&\e177
1424*699cd480SApple OSS Distributions.It Dv VWERASE  Ta WERASE Ta \&^W
1425*699cd480SApple OSS Distributions.It Dv VKILL Ta KILL Ta \&^U
1426*699cd480SApple OSS Distributions.It Dv VREPRINT Ta REPRINT Ta \&^R
1427*699cd480SApple OSS Distributions.It Dv VINTR Ta INTR Ta \&^C
1428*699cd480SApple OSS Distributions.It Dv VQUIT Ta QUIT Ta \&^\e\e Ql \&\e34
1429*699cd480SApple OSS Distributions.It Dv VSUSP Ta SUSP Ta \&^Z
1430*699cd480SApple OSS Distributions.It Dv VDSUSP Ta DSUSP Ta \&^Y
1431*699cd480SApple OSS Distributions.It Dv VSTART Ta START Ta \&^Q
1432*699cd480SApple OSS Distributions.It Dv VSTOP Ta STOP Ta \&^S
1433*699cd480SApple OSS Distributions.It Dv VLNEXT Ta LNEXT Ta \&^V
1434*699cd480SApple OSS Distributions.It Dv VDISCARD Ta DISCARD Ta \&^O
1435*699cd480SApple OSS Distributions.It Dv VMIN Ta --- Ta \&1
1436*699cd480SApple OSS Distributions.It Dv VTIME Ta --- Ta \&0
1437*699cd480SApple OSS Distributions.It Dv VSTATUS Ta STATUS Ta \&^T
1438*699cd480SApple OSS Distributions.El
1439*699cd480SApple OSS Distributions.Pp
1440*699cd480SApple OSS DistributionsIf the
1441*699cd480SApple OSS Distributionsvalue of one of the changeable special control characters (see
1442*699cd480SApple OSS Distributions.Sx "Special Characters" )
1443*699cd480SApple OSS Distributionsis
1444*699cd480SApple OSS Distributions.Dv {_POSIX_VDISABLE} ,
1445*699cd480SApple OSS Distributionsthat function is disabled; that is, no input
1446*699cd480SApple OSS Distributionsdata is recognized as the disabled special character.
1447*699cd480SApple OSS DistributionsIf
1448*699cd480SApple OSS Distributions.Dv ICANON
1449*699cd480SApple OSS Distributionsis
1450*699cd480SApple OSS Distributionsnot set, the value of
1451*699cd480SApple OSS Distributions.Dv {_POSIX_VDISABLE}
1452*699cd480SApple OSS Distributionshas no special meaning for the
1453*699cd480SApple OSS Distributions.Dv VMIN
1454*699cd480SApple OSS Distributionsand
1455*699cd480SApple OSS Distributions.Dv VTIME
1456*699cd480SApple OSS Distributionsentries of the
1457*699cd480SApple OSS Distributions.Fa c_cc
1458*699cd480SApple OSS Distributionsarray.
1459*699cd480SApple OSS Distributions.Pp
1460*699cd480SApple OSS DistributionsThe initial values of the flags and control characters
1461*699cd480SApple OSS Distributionsafter open() is set according to
1462*699cd480SApple OSS Distributionsthe values in the header
1463*699cd480SApple OSS Distributions.Aq Pa sys/ttydefaults.h .
1464*699cd480SApple OSS Distributions.Sh SEE ALSO
1465*699cd480SApple OSS Distributions.Xr tcgetattr 3 ,
1466*699cd480SApple OSS Distributions.Xr tcsetattr 3
1467