xref: /freebsd/share/man/man4/termios.4 (revision 2dcf8c45934e4632a7d5780afc0058554245f1f1)
1afe61c15SRodney W. Grimes.\" Copyright (c) 1991, 1992, 1993
2afe61c15SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3afe61c15SRodney W. Grimes.\"
4afe61c15SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5afe61c15SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6afe61c15SRodney W. Grimes.\" are met:
7afe61c15SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9afe61c15SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11afe61c15SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors
13afe61c15SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
14afe61c15SRodney W. Grimes.\"    without specific prior written permission.
15afe61c15SRodney W. Grimes.\"
16afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19afe61c15SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26afe61c15SRodney W. Grimes.\" SUCH DAMAGE.
27afe61c15SRodney W. Grimes.\"
28afe61c15SRodney W. Grimes.\"	@(#)termios.4	8.4 (Berkeley) 4/19/94
297f3dea24SPeter Wemm.\" $FreeBSD$
30afe61c15SRodney W. Grimes.\"
31*2dcf8c45SMichael Gmelin.Dd June 27, 2020
32afe61c15SRodney W. Grimes.Dt TERMIOS 4
333d45e180SRuslan Ermilov.Os
34afe61c15SRodney W. Grimes.Sh NAME
35afe61c15SRodney W. Grimes.Nm termios
36afe61c15SRodney W. Grimes.Nd general terminal line discipline
37afe61c15SRodney W. Grimes.Sh SYNOPSIS
3832eef9aeSRuslan Ermilov.In termios.h
39afe61c15SRodney W. Grimes.Sh DESCRIPTION
40afe61c15SRodney W. GrimesThis describes a general terminal line discipline that is
41afe61c15SRodney W. Grimessupported on tty asynchronous communication ports.
42afe61c15SRodney W. Grimes.Ss Opening a Terminal Device File
43afe61c15SRodney W. GrimesWhen a terminal file is opened, it normally causes the process to wait
44b5e7e999SRuslan Ermilovuntil a connection is established.
45b5e7e999SRuslan ErmilovFor most hardware, the presence
46afe61c15SRodney W. Grimesof a connection is indicated by the assertion of the hardware
47d0353b83SRuslan Ermilov.Dv CARRIER
48d0353b83SRuslan Ermilovline.
49afe61c15SRodney W. GrimesIf the termios structure associated with the terminal file has the
50afe61c15SRodney W. Grimes.Dv CLOCAL
51afe61c15SRodney W. Grimesflag set in the cflag, or if the
52afe61c15SRodney W. Grimes.Dv O_NONBLOCK
53afe61c15SRodney W. Grimesflag is set
54afe61c15SRodney W. Grimesin the
55afe61c15SRodney W. Grimes.Xr open 2
56afe61c15SRodney W. Grimescall, then the open will succeed even without
57afe61c15SRodney W. Grimesa connection being present.
58afe61c15SRodney W. GrimesIn practice, applications
59afe61c15SRodney W. Grimesseldom open these files; they are opened by special programs, such
60afe61c15SRodney W. Grimesas
6176acea15SEd Maste.Xr getty 8 ,
62afe61c15SRodney W. Grimesand become
63afe61c15SRodney W. Grimesan application's standard input, output, and error files.
64afe61c15SRodney W. Grimes.Ss Job Control in a Nutshell
65afe61c15SRodney W. GrimesEvery process is associated with a particular process group and session.
66afe61c15SRodney W. GrimesThe grouping is hierarchical: every member of a particular process group is a
67b5e7e999SRuslan Ermilovmember of the same session.
68b5e7e999SRuslan ErmilovThis structuring is used in managing groups
69afe61c15SRodney W. Grimesof related processes for purposes of
70afe61c15SRodney W. Grimes.\" .Gw "job control" ;
71afe61c15SRodney W. Grimes.Em "job control" ;
72afe61c15SRodney W. Grimesthat is, the
73afe61c15SRodney W. Grimesability from the keyboard (or from program control) to simultaneously
74afe61c15SRodney W. Grimesstop or restart
75afe61c15SRodney W. Grimesa complex command (a command composed of one or more related
76b5e7e999SRuslan Ermilovprocesses).
77b5e7e999SRuslan ErmilovThe grouping into process groups allows delivering
78afe61c15SRodney W. Grimesof signals that stop or start the group as a whole, along with
79afe61c15SRodney W. Grimesarbitrating which process group has access to the single controlling
80b5e7e999SRuslan Ermilovterminal.
81b5e7e999SRuslan ErmilovThe grouping at a higher layer into sessions is to restrict
82afe61c15SRodney W. Grimesthe job control related signals and system calls to within processes
83b5e7e999SRuslan Ermilovresulting from a particular instance of a
84b5e7e999SRuslan Ermilov.Dq login .
85b5e7e999SRuslan ErmilovTypically, a session
86afe61c15SRodney W. Grimesis created when a user logs in, and the login terminal is setup
87afe61c15SRodney W. Grimesto be the controlling terminal; all processes spawned from that
88afe61c15SRodney W. Grimeslogin shell are in the same session, and inherit the controlling
89afe61c15SRodney W. Grimesterminal.
90edf0e5b3SMike Pritchard.Pp
91afe61c15SRodney W. GrimesA job control shell
92afe61c15SRodney W. Grimesoperating interactively (that is, reading commands from a terminal)
93afe61c15SRodney W. Grimesnormally groups related processes together by placing them into the
94b5e7e999SRuslan Ermilovsame process group.
95b5e7e999SRuslan ErmilovA set of processes in the same process group
96b5e7e999SRuslan Ermilovis collectively referred to as a
97b5e7e999SRuslan Ermilov.Dq job .
98b5e7e999SRuslan ErmilovWhen the foreground process
99afe61c15SRodney W. Grimesgroup of the terminal is the same as the process group of a particular
100b5e7e999SRuslan Ermilovjob, that job is said to be in the
101b5e7e999SRuslan Ermilov.Dq foreground .
102b5e7e999SRuslan ErmilovWhen the process group of the terminal is different from the process group of
103afe61c15SRodney W. Grimesa job (but is still the controlling terminal), that job is said
104b5e7e999SRuslan Ermilovto be in the
105b5e7e999SRuslan Ermilov.Dq background .
106b5e7e999SRuslan ErmilovNormally the
107afe61c15SRodney W. Grimesshell reads a command and starts the job that implements that
108b5e7e999SRuslan Ermilovcommand.
109b5e7e999SRuslan ErmilovIf the command is to be started in the foreground (typical), it
110afe61c15SRodney W. Grimessets the process group of the terminal to the process group
111afe61c15SRodney W. Grimesof the started job, waits for the job to complete, and then
112afe61c15SRodney W. Grimessets the process group of the terminal back to its own process
113b5e7e999SRuslan Ermilovgroup (it puts itself into the foreground).
114b5e7e999SRuslan ErmilovIf the job is to
115afe61c15SRodney W. Grimesbe started in the background (as denoted by the shell operator "&"),
1160227791bSRuslan Ermilovit never changes the process group of the terminal and does not
117afe61c15SRodney W. Grimeswait for the job to complete (that is, it immediately attempts to read the next
118b5e7e999SRuslan Ermilovcommand).
119b5e7e999SRuslan ErmilovIf the job is started in the foreground, the user may
120afe61c15SRodney W. Grimestype a key (usually
121afe61c15SRodney W. Grimes.Ql \&^Z )
122afe61c15SRodney W. Grimeswhich generates the terminal stop signal
123afe61c15SRodney W. Grimes.Pq Dv SIGTSTP
124db3357b8SSheldon Hearnand has the effect of stopping the entire job.
125afe61c15SRodney W. GrimesThe shell will notice that the job stopped, and will resume running after
126afe61c15SRodney W. Grimesplacing itself in the foreground.
127afe61c15SRodney W. GrimesThe shell also has commands for placing stopped jobs in the background,
128afe61c15SRodney W. Grimesand for placing stopped or background jobs into the foreground.
129afe61c15SRodney W. Grimes.Ss Orphaned Process Groups
130afe61c15SRodney W. GrimesAn orphaned process group is a process group that has no process
131afe61c15SRodney W. Grimeswhose parent is in a different process group, yet is in the same
132b5e7e999SRuslan Ermilovsession.
1330227791bSRuslan ErmilovConceptually it means a process group that does not have
134b5e7e999SRuslan Ermilova parent that could do anything if it were to be stopped.
135b5e7e999SRuslan ErmilovFor example,
136afe61c15SRodney W. Grimesthe initial login shell is typically in an orphaned process group.
137afe61c15SRodney W. GrimesOrphaned process groups are immune to keyboard generated stop
138afe61c15SRodney W. Grimessignals and job control signals resulting from reads or writes to the
139afe61c15SRodney W. Grimescontrolling terminal.
140afe61c15SRodney W. Grimes.Ss The Controlling Terminal
141b5e7e999SRuslan ErmilovA terminal may belong to a process as its controlling terminal.
142b5e7e999SRuslan ErmilovEach
143afe61c15SRodney W. Grimesprocess of a session that has a controlling terminal has the same
144b5e7e999SRuslan Ermilovcontrolling terminal.
145b5e7e999SRuslan ErmilovA terminal may be the controlling terminal for at
146b5e7e999SRuslan Ermilovmost one session.
147b5e7e999SRuslan ErmilovThe controlling terminal for a session is allocated by
148afe61c15SRodney W. Grimesthe session leader by issuing the
149afe61c15SRodney W. Grimes.Dv TIOCSCTTY
1505203edcdSRuslan Ermilovioctl.
1515203edcdSRuslan ErmilovA controlling terminal
152afe61c15SRodney W. Grimesis never acquired by merely opening a terminal device file.
153afe61c15SRodney W. GrimesWhen a controlling terminal becomes
154afe61c15SRodney W. Grimesassociated with a session, its foreground process group is set to
155afe61c15SRodney W. Grimesthe process group of the session leader.
156afe61c15SRodney W. Grimes.Pp
157afe61c15SRodney W. GrimesThe controlling terminal is inherited by a child process during a
158afe61c15SRodney W. Grimes.Xr fork 2
159b5e7e999SRuslan Ermilovfunction call.
160b5e7e999SRuslan ErmilovA process relinquishes its controlling terminal when it
161afe61c15SRodney W. Grimescreates a new session with the
162929f3023SJoseph Koshy.Xr setsid 2
163afe61c15SRodney W. Grimesfunction; other processes
164afe61c15SRodney W. Grimesremaining in the old session that had this terminal as their controlling
165afe61c15SRodney W. Grimesterminal continue to have it.
166afe61c15SRodney W. GrimesA process does not relinquish its
167afe61c15SRodney W. Grimescontrolling terminal simply by closing all of its file descriptors
168afe61c15SRodney W. Grimesassociated with the controlling terminal if other processes continue to
169afe61c15SRodney W. Grimeshave it open.
170afe61c15SRodney W. Grimes.Pp
171afe61c15SRodney W. GrimesWhen a controlling process terminates, the controlling terminal is
172afe61c15SRodney W. Grimesdisassociated from the current session, allowing it to be acquired by a
173b5e7e999SRuslan Ermilovnew session leader.
174b5e7e999SRuslan ErmilovSubsequent access to the terminal by other processes
175afe61c15SRodney W. Grimesin the earlier session will be denied, with attempts to access the
176afe61c15SRodney W. Grimesterminal treated as if modem disconnect had been sensed.
177afe61c15SRodney W. Grimes.Ss Terminal Access Control
178afe61c15SRodney W. GrimesIf a process is in the foreground process group of its controlling
179afe61c15SRodney W. Grimesterminal, read operations are allowed.
180afe61c15SRodney W. GrimesAny attempts by a process
181afe61c15SRodney W. Grimesin a background process group to read from its controlling terminal
182afe61c15SRodney W. Grimescauses a
183afe61c15SRodney W. Grimes.Dv SIGTTIN
184afe61c15SRodney W. Grimessignal to be sent to
185afe61c15SRodney W. Grimesthe process's group
186afe61c15SRodney W. Grimesunless one of the
1875203edcdSRuslan Ermilovfollowing special cases apply: if the reading process is ignoring or
188afe61c15SRodney W. Grimesblocking the
189f167d7fbSSheldon Hearn.Dv SIGTTIN
190f167d7fbSSheldon Hearnsignal, or if the process group of the reading
191afe61c15SRodney W. Grimesprocess is orphaned, the
192afe61c15SRodney W. Grimes.Xr read 2
193afe61c15SRodney W. Grimesreturns -1 with
19450d922a0SGlen Barber.Va errno
19550d922a0SGlen Barberset to
196b92a189eSRuslan Ermilov.Er EIO
197afe61c15SRodney W. Grimesand no
1985203edcdSRuslan Ermilovsignal is sent.
1995203edcdSRuslan ErmilovThe default action of the
200afe61c15SRodney W. Grimes.Dv SIGTTIN
201afe61c15SRodney W. Grimessignal is to stop the
202afe61c15SRodney W. Grimesprocess to which it is sent.
203afe61c15SRodney W. Grimes.Pp
204afe61c15SRodney W. GrimesIf a process is in the foreground process group of its controlling
205afe61c15SRodney W. Grimesterminal, write operations are allowed.
206afe61c15SRodney W. GrimesAttempts by a process in a background process group to write to its
207afe61c15SRodney W. Grimescontrolling terminal will cause the process group to be sent a
208afe61c15SRodney W. Grimes.Dv SIGTTOU
2095203edcdSRuslan Ermilovsignal unless one of the following special cases apply: if
210afe61c15SRodney W. Grimes.Dv TOSTOP
211afe61c15SRodney W. Grimesis not
212afe61c15SRodney W. Grimesset, or if
213afe61c15SRodney W. Grimes.Dv TOSTOP
214afe61c15SRodney W. Grimesis set and the process is ignoring or blocking the
215afe61c15SRodney W. Grimes.Dv SIGTTOU
216afe61c15SRodney W. Grimessignal, the process is allowed to write to the terminal and the
217afe61c15SRodney W. Grimes.Dv SIGTTOU
218b5e7e999SRuslan Ermilovsignal is not sent.
219b5e7e999SRuslan ErmilovIf
220afe61c15SRodney W. Grimes.Dv TOSTOP
221afe61c15SRodney W. Grimesis set, and the process group of
222afe61c15SRodney W. Grimesthe writing process is orphaned, and the writing process is not ignoring
223afe61c15SRodney W. Grimesor blocking
224afe61c15SRodney W. Grimes.Dv SIGTTOU ,
225afe61c15SRodney W. Grimesthe
226edf0e5b3SMike Pritchard.Xr write 2
227afe61c15SRodney W. Grimesreturns -1 with
228afe61c15SRodney W. Grimeserrno set to
229b92a189eSRuslan Ermilov.Er EIO
230afe61c15SRodney W. Grimesand no signal is sent.
231afe61c15SRodney W. Grimes.Pp
232afe61c15SRodney W. GrimesCertain calls that set terminal parameters are treated in the same
233afe61c15SRodney W. Grimesfashion as write, except that
234afe61c15SRodney W. Grimes.Dv TOSTOP
235afe61c15SRodney W. Grimesis ignored; that is, the effect is
236afe61c15SRodney W. Grimesidentical to that of terminal writes when
237afe61c15SRodney W. Grimes.Dv TOSTOP
238afe61c15SRodney W. Grimesis set.
239afe61c15SRodney W. Grimes.Ss Input Processing and Reading Data
240afe61c15SRodney W. GrimesA terminal device associated with a terminal device file may operate in
241afe61c15SRodney W. Grimesfull-duplex mode, so that data may arrive even while output is occurring.
242afe61c15SRodney W. GrimesEach terminal device file has associated with it an input queue, into
243afe61c15SRodney W. Grimeswhich incoming data is stored by the system before being read by a
2445203edcdSRuslan Ermilovprocess.
2455203edcdSRuslan ErmilovThe system imposes a limit,
246afe61c15SRodney W. Grimes.Pf \&{ Dv MAX_INPUT Ns \&} ,
247afe61c15SRodney W. Grimeson the number of
248b5e7e999SRuslan Ermilovbytes that may be stored in the input queue.
249b5e7e999SRuslan ErmilovThe behavior of the system
250afe61c15SRodney W. Grimeswhen this limit is exceeded depends on the setting of the
251afe61c15SRodney W. Grimes.Dv IMAXBEL
252afe61c15SRodney W. Grimesflag in the termios
253afe61c15SRodney W. Grimes.Fa c_iflag .
254afe61c15SRodney W. GrimesIf this flag is set, the terminal
255afe61c15SRodney W. Grimesis sent an
256afe61c15SRodney W. Grimes.Tn ASCII
257afe61c15SRodney W. Grimes.Dv BEL
258afe61c15SRodney W. Grimescharacter each time a character is received
259b5e7e999SRuslan Ermilovwhile the input queue is full.
260b5e7e999SRuslan ErmilovOtherwise, the input queue is flushed upon receiving the character.
261afe61c15SRodney W. Grimes.Pp
262afe61c15SRodney W. GrimesTwo general kinds of input processing are available, determined by
263afe61c15SRodney W. Grimeswhether the terminal device file is in canonical mode or noncanonical
2646d249eeeSSheldon Hearnmode.
2656d249eeeSSheldon HearnAdditionally,
266afe61c15SRodney W. Grimesinput characters are processed according to the
267afe61c15SRodney W. Grimes.Fa c_iflag
268afe61c15SRodney W. Grimesand
269afe61c15SRodney W. Grimes.Fa c_lflag
2705203edcdSRuslan Ermilovfields.
2715203edcdSRuslan ErmilovSuch processing can include echoing, which
272afe61c15SRodney W. Grimesin general means transmitting input characters immediately back to the
273b5e7e999SRuslan Ermilovterminal when they are received from the terminal.
274b5e7e999SRuslan ErmilovThis is useful for terminals that can operate in full-duplex mode.
275afe61c15SRodney W. Grimes.Pp
276afe61c15SRodney W. GrimesThe manner in which data is provided to a process reading from a terminal
277afe61c15SRodney W. Grimesdevice file is dependent on whether the terminal device file is in
278afe61c15SRodney W. Grimescanonical or noncanonical mode.
279afe61c15SRodney W. Grimes.Pp
280afe61c15SRodney W. GrimesAnother dependency is whether the
281afe61c15SRodney W. Grimes.Dv O_NONBLOCK
282afe61c15SRodney W. Grimesflag is set by
283edf0e5b3SMike Pritchard.Xr open 2
284afe61c15SRodney W. Grimesor
285edf0e5b3SMike Pritchard.Xr fcntl 2 .
286afe61c15SRodney W. GrimesIf the
287afe61c15SRodney W. Grimes.Dv O_NONBLOCK
288afe61c15SRodney W. Grimesflag is clear, then the read request is
289b5e7e999SRuslan Ermilovblocked until data is available or a signal has been received.
290b5e7e999SRuslan ErmilovIf the
291afe61c15SRodney W. Grimes.Dv O_NONBLOCK
292afe61c15SRodney W. Grimesflag is set, then the read request is completed, without
293afe61c15SRodney W. Grimesblocking, in one of three ways:
294afe61c15SRodney W. Grimes.Bl -enum -offset indent
295afe61c15SRodney W. Grimes.It
296afe61c15SRodney W. GrimesIf there is enough data available to satisfy the entire request,
297afe61c15SRodney W. Grimesand the read completes successfully the number of
298afe61c15SRodney W. Grimesbytes read is returned.
299afe61c15SRodney W. Grimes.It
300afe61c15SRodney W. GrimesIf there is not enough data available to satisfy the entire
301afe61c15SRodney W. Grimesrequest, and the read completes successfully, having read as
302afe61c15SRodney W. Grimesmuch data as possible, the number of bytes read is returned.
303afe61c15SRodney W. Grimes.It
304afe61c15SRodney W. GrimesIf there is no data available, the read returns -1, with
305afe61c15SRodney W. Grimeserrno set to
306afe61c15SRodney W. Grimes.Er EAGAIN .
307afe61c15SRodney W. Grimes.El
308afe61c15SRodney W. Grimes.Pp
309afe61c15SRodney W. GrimesWhen data is available depends on whether the input processing mode is
310afe61c15SRodney W. Grimescanonical or noncanonical.
311afe61c15SRodney W. Grimes.Ss Canonical Mode Input Processing
312afe61c15SRodney W. GrimesIn canonical mode input processing, terminal input is processed in units
3135203edcdSRuslan Ermilovof lines.
3145203edcdSRuslan ErmilovA line is delimited by a newline
315afe61c15SRodney W. Grimes.Ql \&\en
316afe61c15SRodney W. Grimescharacter, an end-of-file
317afe61c15SRodney W. Grimes.Pq Dv EOF
318afe61c15SRodney W. Grimescharacter, or an end-of-line
319afe61c15SRodney W. Grimes.Pq Dv EOL
3205203edcdSRuslan Ermilovcharacter.
3215203edcdSRuslan ErmilovSee the
322afe61c15SRodney W. Grimes.Sx "Special Characters"
323afe61c15SRodney W. Grimessection for
324afe61c15SRodney W. Grimesmore information on
325afe61c15SRodney W. Grimes.Dv EOF
326afe61c15SRodney W. Grimesand
327afe61c15SRodney W. Grimes.Dv EOL .
328afe61c15SRodney W. GrimesThis means that a read request will
329afe61c15SRodney W. Grimesnot return until an entire line has been typed, or a signal has been
330b5e7e999SRuslan Ermilovreceived.
331b5e7e999SRuslan ErmilovAlso, no matter how many bytes are requested in the read call,
332b5e7e999SRuslan Ermilovat most one line is returned.
333b5e7e999SRuslan ErmilovIt is not, however, necessary to
334afe61c15SRodney W. Grimesread a whole line at once; any number of bytes, even one, may be
335afe61c15SRodney W. Grimesrequested in a read without losing information.
336afe61c15SRodney W. Grimes.Pp
337afe61c15SRodney W. Grimes.Pf \&{ Dv MAX_CANON Ns \&}
338afe61c15SRodney W. Grimesis a limit on the
339afe61c15SRodney W. Grimesnumber of bytes in a line.
340afe61c15SRodney W. GrimesThe behavior of the system when this limit is
341afe61c15SRodney W. Grimesexceeded is the same as when the input queue limit
342afe61c15SRodney W. Grimes.Pf \&{ Dv MAX_INPUT Ns \&} ,
343afe61c15SRodney W. Grimesis exceeded.
344afe61c15SRodney W. Grimes.Pp
345afe61c15SRodney W. GrimesErase and kill processing occur when either of two special characters,
346afe61c15SRodney W. Grimesthe
347afe61c15SRodney W. Grimes.Dv ERASE
348afe61c15SRodney W. Grimesand
349afe61c15SRodney W. Grimes.Dv KILL
350afe61c15SRodney W. Grimescharacters (see the
3516e679990SPawel Jakub Dawidek.Sx "Special Characters"
3526e679990SPawel Jakub Dawideksection), is received.
353afe61c15SRodney W. GrimesThis processing affects data in the input queue that has not yet been
354afe61c15SRodney W. Grimesdelimited by a newline
355afe61c15SRodney W. Grimes.Dv NL ,
356afe61c15SRodney W. Grimes.Dv EOF ,
357afe61c15SRodney W. Grimesor
358afe61c15SRodney W. Grimes.Dv EOL
3595203edcdSRuslan Ermilovcharacter.
3605203edcdSRuslan ErmilovThis un-delimited
361b5e7e999SRuslan Ermilovdata makes up the current line.
362b5e7e999SRuslan ErmilovThe
363afe61c15SRodney W. Grimes.Dv ERASE
364afe61c15SRodney W. Grimescharacter deletes the last
365b5e7e999SRuslan Ermilovcharacter in the current line, if there is any.
366b5e7e999SRuslan ErmilovThe
367afe61c15SRodney W. Grimes.Dv KILL
368afe61c15SRodney W. Grimescharacter
369b5e7e999SRuslan Ermilovdeletes all data in the current line, if there is any.
370b5e7e999SRuslan ErmilovThe
371afe61c15SRodney W. Grimes.Dv ERASE
372afe61c15SRodney W. Grimesand
373afe61c15SRodney W. Grimes.Dv KILL
374afe61c15SRodney W. Grimescharacters have no effect if there is no data in the current line.
375afe61c15SRodney W. GrimesThe
376afe61c15SRodney W. Grimes.Dv ERASE
377afe61c15SRodney W. Grimesand
378afe61c15SRodney W. Grimes.Dv KILL
379afe61c15SRodney W. Grimescharacters themselves are not placed in the input
380afe61c15SRodney W. Grimesqueue.
381afe61c15SRodney W. Grimes.Ss Noncanonical Mode Input Processing
382afe61c15SRodney W. GrimesIn noncanonical mode input processing, input bytes are not assembled into
383b5e7e999SRuslan Ermilovlines, and erase and kill processing does not occur.
384b5e7e999SRuslan ErmilovThe values of the
385ed7922d3SMike Pritchard.Dv VMIN
386afe61c15SRodney W. Grimesand
387ed7922d3SMike Pritchard.Dv VTIME
388afe61c15SRodney W. Grimesmembers of the
389afe61c15SRodney W. Grimes.Fa c_cc
390afe61c15SRodney W. Grimesarray are used to determine how to
391afe61c15SRodney W. Grimesprocess the bytes received.
392afe61c15SRodney W. Grimes.Pp
3935f1376d7SMike Pritchard.Dv MIN
394afe61c15SRodney W. Grimesrepresents the minimum number of bytes that should be received when
395afe61c15SRodney W. Grimesthe
396edf0e5b3SMike Pritchard.Xr read 2
397afe61c15SRodney W. Grimesfunction successfully returns.
3985f1376d7SMike Pritchard.Dv TIME
399afe61c15SRodney W. Grimesis a timer of 0.1 second
400afe61c15SRodney W. Grimesgranularity that is used to time out bursty and short term data
4015203edcdSRuslan Ermilovtransmissions.
4025203edcdSRuslan ErmilovIf
4035f1376d7SMike Pritchard.Dv MIN
404afe61c15SRodney W. Grimesis greater than
405afe61c15SRodney W. Grimes.Dv \&{ Dv MAX_INPUT Ns \&} ,
406afe61c15SRodney W. Grimesthe response to the
407b5e7e999SRuslan Ermilovrequest is undefined.
408b5e7e999SRuslan ErmilovThe four possible values for
4095f1376d7SMike Pritchard.Dv MIN
410afe61c15SRodney W. Grimesand
4115f1376d7SMike Pritchard.Dv TIME
412afe61c15SRodney W. Grimesand
413afe61c15SRodney W. Grimestheir interactions are described below.
4145f1376d7SMike Pritchard.Ss "Case A: MIN > 0, TIME > 0"
415afe61c15SRodney W. GrimesIn this case
4165f1376d7SMike Pritchard.Dv TIME
417afe61c15SRodney W. Grimesserves as an inter-byte timer and is activated after
418b5e7e999SRuslan Ermilovthe first byte is received.
419b5e7e999SRuslan ErmilovSince it is an inter-byte timer, it is reset
420b5e7e999SRuslan Ermilovafter a byte is received.
421b5e7e999SRuslan ErmilovThe interaction between
4225f1376d7SMike Pritchard.Dv MIN
423afe61c15SRodney W. Grimesand
4245f1376d7SMike Pritchard.Dv TIME
425afe61c15SRodney W. Grimesis as
426afe61c15SRodney W. Grimesfollows: as soon as one byte is received, the inter-byte timer is
4275203edcdSRuslan Ermilovstarted.
4285203edcdSRuslan ErmilovIf
4295f1376d7SMike Pritchard.Dv MIN
430afe61c15SRodney W. Grimesbytes are received before the inter-byte timer expires
431afe61c15SRodney W. Grimes(remember that the timer is reset upon receipt of each byte), the read is
432b5e7e999SRuslan Ermilovsatisfied.
433b5e7e999SRuslan ErmilovIf the timer expires before
4345f1376d7SMike Pritchard.Dv MIN
435afe61c15SRodney W. Grimesbytes are received, the
436b5e7e999SRuslan Ermilovcharacters received to that point are returned to the user.
437b5e7e999SRuslan ErmilovNote that if
4385f1376d7SMike Pritchard.Dv TIME
439afe61c15SRodney W. Grimesexpires at least one byte is returned because the timer would
440b5e7e999SRuslan Ermilovnot have been enabled unless a byte was received.
441b5e7e999SRuslan ErmilovIn this case
4425f1376d7SMike Pritchard.Pf \&( Dv MIN
443afe61c15SRodney W. Grimes> 0,
4445f1376d7SMike Pritchard.Dv TIME
445afe61c15SRodney W. Grimes> 0) the read blocks until the
4465f1376d7SMike Pritchard.Dv MIN
447afe61c15SRodney W. Grimesand
4485f1376d7SMike Pritchard.Dv TIME
449afe61c15SRodney W. Grimesmechanisms are
450b5e7e999SRuslan Ermilovactivated by the receipt of the first byte, or a signal is received.
451b5e7e999SRuslan ErmilovIf data is in the buffer at the time of the
452edf0e5b3SMike Pritchard.Fn read ,
453edf0e5b3SMike Pritchardthe result is as
454edf0e5b3SMike Pritchardif data had been received immediately after the
455edf0e5b3SMike Pritchard.Fn read .
4565f1376d7SMike Pritchard.Ss "Case B: MIN > 0, TIME = 0"
457afe61c15SRodney W. GrimesIn this case, since the value of
4585f1376d7SMike Pritchard.Dv TIME
459afe61c15SRodney W. Grimesis zero, the timer plays no role
460afe61c15SRodney W. Grimesand only
4615f1376d7SMike Pritchard.Dv MIN
462b5e7e999SRuslan Ermilovis significant.
463b5e7e999SRuslan ErmilovA pending read is not satisfied until
4645f1376d7SMike Pritchard.Dv MIN
465afe61c15SRodney W. Grimesbytes are received (i.e., the pending read blocks until
4665f1376d7SMike Pritchard.Dv MIN
467afe61c15SRodney W. Grimesbytes
468b5e7e999SRuslan Ermilovare received), or a signal is received.
469b5e7e999SRuslan ErmilovA program that uses this case to read record-based terminal
470afe61c15SRodney W. Grimes.Dv I/O
471afe61c15SRodney W. Grimesmay block indefinitely in the read
472afe61c15SRodney W. Grimesoperation.
4735f1376d7SMike Pritchard.Ss "Case C: MIN = 0, TIME > 0"
474afe61c15SRodney W. GrimesIn this case, since
4755f1376d7SMike Pritchard.Dv MIN
476afe61c15SRodney W. Grimes= 0,
4775f1376d7SMike Pritchard.Dv TIME
478afe61c15SRodney W. Grimesno longer represents an inter-byte
479b5e7e999SRuslan Ermilovtimer.
480b5e7e999SRuslan ErmilovIt now serves as a read timer that is activated as soon as the
481b5e7e999SRuslan Ermilovread function is processed.
482b5e7e999SRuslan ErmilovA read is satisfied as soon as a single
483b5e7e999SRuslan Ermilovbyte is received or the read timer expires.
484b5e7e999SRuslan ErmilovNote that in this case if the timer expires, no bytes are returned.
485b5e7e999SRuslan ErmilovIf the timer does not
486afe61c15SRodney W. Grimesexpire, the only way the read can be satisfied is if a byte is received.
487afe61c15SRodney W. GrimesIn this case the read will not block indefinitely waiting for a byte; if
488afe61c15SRodney W. Grimesno byte is received within
4895f1376d7SMike Pritchard.Dv TIME Ns *0.1
490afe61c15SRodney W. Grimesseconds after the read is initiated,
491b5e7e999SRuslan Ermilovthe read returns a value of zero, having read no data.
492b5e7e999SRuslan ErmilovIf data is
493afe61c15SRodney W. Grimesin the buffer at the time of the read, the timer is started as if
494afe61c15SRodney W. Grimesdata had been received immediately after the read.
4955f1376d7SMike Pritchard.Ss Case D: MIN = 0, TIME = 0
496afe61c15SRodney W. GrimesThe minimum of either the number of bytes requested or the number of
497afe61c15SRodney W. Grimesbytes currently available is returned without waiting for more
498b5e7e999SRuslan Ermilovbytes to be input.
499b5e7e999SRuslan ErmilovIf no characters are available, read returns a
500afe61c15SRodney W. Grimesvalue of zero, having read no data.
501afe61c15SRodney W. Grimes.Ss Writing Data and Output Processing
502afe61c15SRodney W. GrimesWhen a process writes one or more bytes to a terminal device file, they
503afe61c15SRodney W. Grimesare processed according to the
504afe61c15SRodney W. Grimes.Fa c_oflag
505afe61c15SRodney W. Grimesfield (see the
5066e679990SPawel Jakub Dawidek.Sx "Output Modes"
5075203edcdSRuslan Ermilovsection).
5085203edcdSRuslan ErmilovThe
509afe61c15SRodney W. Grimesimplementation may provide a buffering mechanism; as such, when a call to
510edf0e5b3SMike Pritchard.Fn write
511edf0e5b3SMike Pritchardcompletes, all of the bytes written have been scheduled for
512afe61c15SRodney W. Grimestransmission to the device, but the transmission will not necessarily
513afe61c15SRodney W. Grimeshave been completed.
514afe61c15SRodney W. Grimes.\" See also .Sx "6.4.2" for the effects of
515afe61c15SRodney W. Grimes.\" .Dv O_NONBLOCK
516afe61c15SRodney W. Grimes.\" on write.
517afe61c15SRodney W. Grimes.Ss Special Characters
518afe61c15SRodney W. GrimesCertain characters have special functions on input or output or both.
519afe61c15SRodney W. GrimesThese functions are summarized as follows:
520afe61c15SRodney W. Grimes.Bl -tag -width indent
521afe61c15SRodney W. Grimes.It Dv INTR
522afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
523afe61c15SRodney W. Grimes.Dv ISIG
524afe61c15SRodney W. Grimesflag (see the
525afe61c15SRodney W. Grimes.Sx "Local Modes"
526b5e7e999SRuslan Ermilovsection) is enabled.
527b5e7e999SRuslan ErmilovGenerates a
528afe61c15SRodney W. Grimes.Dv SIGINT
529afe61c15SRodney W. Grimessignal which is sent to all processes in the foreground
530afe61c15SRodney W. Grimesprocess group for which the terminal is the controlling
5315203edcdSRuslan Ermilovterminal.
5325203edcdSRuslan ErmilovIf
533afe61c15SRodney W. Grimes.Dv ISIG
534afe61c15SRodney W. Grimesis set, the
535afe61c15SRodney W. Grimes.Dv INTR
536afe61c15SRodney W. Grimescharacter is
537afe61c15SRodney W. Grimesdiscarded when processed.
538afe61c15SRodney W. Grimes.It Dv QUIT
539afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
540afe61c15SRodney W. Grimes.Dv ISIG
541b5e7e999SRuslan Ermilovflag is enabled.
542b5e7e999SRuslan ErmilovGenerates a
543afe61c15SRodney W. Grimes.Dv SIGQUIT
544afe61c15SRodney W. Grimessignal which is
545afe61c15SRodney W. Grimessent to all processes in the foreground process group
546b5e7e999SRuslan Ermilovfor which the terminal is the controlling terminal.
547b5e7e999SRuslan ErmilovIf
548afe61c15SRodney W. Grimes.Dv ISIG
549afe61c15SRodney W. Grimesis set, the
550afe61c15SRodney W. Grimes.Dv QUIT
551afe61c15SRodney W. Grimescharacter is discarded when
552afe61c15SRodney W. Grimesprocessed.
553afe61c15SRodney W. Grimes.It Dv ERASE
554afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
555afe61c15SRodney W. Grimes.Dv ICANON
556b5e7e999SRuslan Ermilovflag is set.
557b5e7e999SRuslan ErmilovErases the last character in the
558afe61c15SRodney W. Grimescurrent line; see
559afe61c15SRodney W. Grimes.Sx "Canonical Mode Input Processing" .
560afe61c15SRodney W. GrimesIt does not erase beyond
561afe61c15SRodney W. Grimesthe start of a line, as delimited by an
562afe61c15SRodney W. Grimes.Dv NL ,
563afe61c15SRodney W. Grimes.Dv EOF ,
564afe61c15SRodney W. Grimesor
565afe61c15SRodney W. Grimes.Dv EOL
566b5e7e999SRuslan Ermilovcharacter.
567b5e7e999SRuslan ErmilovIf
568afe61c15SRodney W. Grimes.Dv ICANON
569afe61c15SRodney W. Grimesis set, the
570afe61c15SRodney W. Grimes.Dv ERASE
571afe61c15SRodney W. Grimescharacter is
572afe61c15SRodney W. Grimesdiscarded when processed.
573afe61c15SRodney W. Grimes.It Dv KILL
574afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
575afe61c15SRodney W. Grimes.Dv ICANON
576b5e7e999SRuslan Ermilovflag is set.
577b5e7e999SRuslan ErmilovDeletes the entire line, as
578afe61c15SRodney W. Grimesdelimited by a
579afe61c15SRodney W. Grimes.Dv NL ,
580afe61c15SRodney W. Grimes.Dv EOF ,
581afe61c15SRodney W. Grimesor
582afe61c15SRodney W. Grimes.Dv EOL
583b5e7e999SRuslan Ermilovcharacter.
584b5e7e999SRuslan ErmilovIf
585afe61c15SRodney W. Grimes.Dv ICANON
586afe61c15SRodney W. Grimesis set, the
587afe61c15SRodney W. Grimes.Dv KILL
588afe61c15SRodney W. Grimescharacter is discarded when processed.
589afe61c15SRodney W. Grimes.It Dv EOF
590afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
591afe61c15SRodney W. Grimes.Dv ICANON
592b5e7e999SRuslan Ermilovflag is set.
593b5e7e999SRuslan ErmilovWhen received, all the bytes
594afe61c15SRodney W. Grimeswaiting to be read are immediately passed to the
595afe61c15SRodney W. Grimesprocess, without waiting for a newline, and the
596afe61c15SRodney W. Grimes.Dv EOF
597b5e7e999SRuslan Ermilovis discarded.
598b5e7e999SRuslan ErmilovThus, if there are no bytes waiting (that is, the
599afe61c15SRodney W. Grimes.Dv EOF
600afe61c15SRodney W. Grimesoccurred at the beginning of a line), a byte
601edf0e5b3SMike Pritchardcount of zero is returned from the
602edf0e5b3SMike Pritchard.Fn read ,
603b5e7e999SRuslan Ermilovrepresenting an end-of-file indication.
604b5e7e999SRuslan ErmilovIf
605afe61c15SRodney W. Grimes.Dv ICANON
606afe61c15SRodney W. Grimesis
607afe61c15SRodney W. Grimesset, the
608afe61c15SRodney W. Grimes.Dv EOF
609afe61c15SRodney W. Grimescharacter is discarded when processed.
610081cb6b3SMark Ovens.It Dv NL
611afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
612afe61c15SRodney W. Grimes.Dv ICANON
613b5e7e999SRuslan Ermilovflag is set.
614b5e7e999SRuslan ErmilovIt is the line delimiter
615afe61c15SRodney W. Grimes.Ql \&\en .
616afe61c15SRodney W. Grimes.It Dv EOL
617afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
618afe61c15SRodney W. Grimes.Dv ICANON
619b5e7e999SRuslan Ermilovflag is set.
620b5e7e999SRuslan ErmilovIs an additional line delimiter, like
621afe61c15SRodney W. Grimes.Dv NL .
622afe61c15SRodney W. Grimes.It Dv SUSP
623afe61c15SRodney W. GrimesIf the
624afe61c15SRodney W. Grimes.Dv ISIG
625afe61c15SRodney W. Grimesflag is enabled, receipt of the
626afe61c15SRodney W. Grimes.Dv SUSP
627afe61c15SRodney W. Grimescharacter causes a
628afe61c15SRodney W. Grimes.Dv SIGTSTP
629afe61c15SRodney W. Grimessignal to be sent to all processes in the
630afe61c15SRodney W. Grimesforeground process group for which the terminal is the
631afe61c15SRodney W. Grimescontrolling terminal, and the
632afe61c15SRodney W. Grimes.Dv SUSP
633afe61c15SRodney W. Grimescharacter is
634afe61c15SRodney W. Grimesdiscarded when processed.
635afe61c15SRodney W. Grimes.It Dv STOP
636afe61c15SRodney W. GrimesSpecial character on both input and output and is
637afe61c15SRodney W. Grimesrecognized if the
638afe61c15SRodney W. Grimes.Dv IXON
639afe61c15SRodney W. Grimes(output control) or
640afe61c15SRodney W. Grimes.Dv IXOFF
641afe61c15SRodney W. Grimes(input
642b5e7e999SRuslan Ermilovcontrol) flag is set.
643b5e7e999SRuslan ErmilovCan be used to temporarily suspend output.
644b5e7e999SRuslan ErmilovIt is useful with fast terminals to
645afe61c15SRodney W. Grimesprevent output from disappearing before it can be read.
646afe61c15SRodney W. GrimesIf
647afe61c15SRodney W. Grimes.Dv IXON
648afe61c15SRodney W. Grimesis set, the
649afe61c15SRodney W. Grimes.Dv STOP
650afe61c15SRodney W. Grimescharacter is discarded when
651afe61c15SRodney W. Grimesprocessed.
652afe61c15SRodney W. Grimes.It Dv START
653afe61c15SRodney W. GrimesSpecial character on both input and output and is
654afe61c15SRodney W. Grimesrecognized if the
655afe61c15SRodney W. Grimes.Dv IXON
656afe61c15SRodney W. Grimes(output control) or
657afe61c15SRodney W. Grimes.Dv IXOFF
658afe61c15SRodney W. Grimes(input
659b5e7e999SRuslan Ermilovcontrol) flag is set.
660b5e7e999SRuslan ErmilovCan be used to resume output that has been suspended by a
661afe61c15SRodney W. Grimes.Dv STOP
6625203edcdSRuslan Ermilovcharacter.
6635203edcdSRuslan ErmilovIf
664afe61c15SRodney W. Grimes.Dv IXON
665afe61c15SRodney W. Grimesis set, the
666afe61c15SRodney W. Grimes.Dv START
667afe61c15SRodney W. Grimescharacter is discarded when processed.
668081cb6b3SMark Ovens.It Dv CR
669afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
670afe61c15SRodney W. Grimes.Dv ICANON
671afe61c15SRodney W. Grimesflag is set; it is the
672afe61c15SRodney W. Grimes.Ql \&\er ,
673afe61c15SRodney W. Grimesas denoted in the
674afe61c15SRodney W. Grimes.Tn \&C
675b5e7e999SRuslan ErmilovStandard {2}.
676b5e7e999SRuslan ErmilovWhen
677afe61c15SRodney W. Grimes.Dv ICANON
678afe61c15SRodney W. Grimesand
679afe61c15SRodney W. Grimes.Dv ICRNL
680afe61c15SRodney W. Grimesare set and
681afe61c15SRodney W. Grimes.Dv IGNCR
682afe61c15SRodney W. Grimesis not set, this character is translated into a
683afe61c15SRodney W. Grimes.Dv NL ,
684afe61c15SRodney W. Grimesand
685afe61c15SRodney W. Grimeshas the same effect as a
686afe61c15SRodney W. Grimes.Dv NL
687afe61c15SRodney W. Grimescharacter.
688afe61c15SRodney W. Grimes.El
689afe61c15SRodney W. Grimes.Pp
690afe61c15SRodney W. GrimesThe following special characters are extensions defined by this
691c3939fb3SRuslan Ermilovsystem and are not a part of
692c3939fb3SRuslan Ermilov.St -p1003.1
693c3939fb3SRuslan Ermilovtermios.
694afe61c15SRodney W. Grimes.Bl -tag -width indent
695afe61c15SRodney W. Grimes.It Dv EOL2
696afe61c15SRodney W. GrimesSecondary
697afe61c15SRodney W. Grimes.Dv EOL
6985203edcdSRuslan Ermilovcharacter.
6995203edcdSRuslan ErmilovSame function as
700afe61c15SRodney W. Grimes.Dv EOL .
701afe61c15SRodney W. Grimes.It Dv WERASE
702afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
703afe61c15SRodney W. Grimes.Dv ICANON
704b5e7e999SRuslan Ermilovflag is set.
705b5e7e999SRuslan ErmilovErases the last word in the current line according to one of two algorithms.
706b5e7e999SRuslan ErmilovIf the
707afe61c15SRodney W. Grimes.Dv ALTWERASE
708afe61c15SRodney W. Grimesflag is not set, first any preceding whitespace is
709afe61c15SRodney W. Grimeserased, and then the maximal sequence of non-whitespace
710b5e7e999SRuslan Ermilovcharacters.
711b5e7e999SRuslan ErmilovIf
712afe61c15SRodney W. Grimes.Dv ALTWERASE
713afe61c15SRodney W. Grimesis set, first any preceding
714afe61c15SRodney W. Grimeswhitespace is erased, and then the maximal sequence
715afe61c15SRodney W. Grimesof alphabetic/underscores or non alphabetic/underscores.
716afe61c15SRodney W. GrimesAs a special case in this second algorithm, the first previous
717afe61c15SRodney W. Grimesnon-whitespace character is skipped in determining
718afe61c15SRodney W. Grimeswhether the preceding word is a sequence of
719b5e7e999SRuslan Ermilovalphabetic/underscores.
720b5e7e999SRuslan ErmilovThis sounds confusing but turns out to be quite practical.
721afe61c15SRodney W. Grimes.It Dv REPRINT
722afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
723afe61c15SRodney W. Grimes.Dv ICANON
724b5e7e999SRuslan Ermilovflag is set.
725b5e7e999SRuslan ErmilovCauses the current input edit line to be retyped.
726afe61c15SRodney W. Grimes.It Dv DSUSP
727afe61c15SRodney W. GrimesHas similar actions to the
728afe61c15SRodney W. Grimes.Dv SUSP
729afe61c15SRodney W. Grimescharacter, except that
730afe61c15SRodney W. Grimesthe
731afe61c15SRodney W. Grimes.Dv SIGTSTP
732afe61c15SRodney W. Grimessignal is delivered when one of the processes
733edf0e5b3SMike Pritchardin the foreground process group issues a
734edf0e5b3SMike Pritchard.Fn read
735edf0e5b3SMike Pritchardto the
736afe61c15SRodney W. Grimescontrolling terminal.
737afe61c15SRodney W. Grimes.It Dv LNEXT
738afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
739afe61c15SRodney W. Grimes.Dv IEXTEN
740b5e7e999SRuslan Ermilovflag is set.
741b5e7e999SRuslan ErmilovReceipt of this character causes the next character to be taken literally.
742afe61c15SRodney W. Grimes.It Dv DISCARD
743afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
744afe61c15SRodney W. Grimes.Dv IEXTEN
745b5e7e999SRuslan Ermilovflag is set.
746b5e7e999SRuslan ErmilovReceipt of this character toggles the flushing of terminal output.
747afe61c15SRodney W. Grimes.It Dv STATUS
748afe61c15SRodney W. GrimesSpecial character on input and is recognized if the
749afe61c15SRodney W. Grimes.Dv ICANON
750b5e7e999SRuslan Ermilovflag is set.
751b5e7e999SRuslan ErmilovReceipt of this character causes a
752afe61c15SRodney W. Grimes.Dv SIGINFO
753afe61c15SRodney W. Grimessignal to be sent to the foreground process group of the
754b5e7e999SRuslan Ermilovterminal.
755b5e7e999SRuslan ErmilovAlso, if the
756afe61c15SRodney W. Grimes.Dv NOKERNINFO
757afe61c15SRodney W. Grimesflag is not set, it
758afe61c15SRodney W. Grimescauses the kernel to write a status message to the terminal
759afe61c15SRodney W. Grimesthat displays the current load average, the name of the
760afe61c15SRodney W. Grimescommand in the foreground, its process ID, the symbolic
761afe61c15SRodney W. Grimeswait channel, the number of user and system seconds used,
762afe61c15SRodney W. Grimesthe percentage of cpu the process is getting, and the resident
763afe61c15SRodney W. Grimesset size of the process.
764*2dcf8c45SMichael Gmelin.Pp
765*2dcf8c45SMichael GmelinIn case the
766*2dcf8c45SMichael Gmelin.Xr sysctl 8
767*2dcf8c45SMichael Gmelinvariable
768*2dcf8c45SMichael Gmelin.Va kern.tty_info_kstacks
769*2dcf8c45SMichael Gmelinis set to a non-zero value, the running thread's stack is
770*2dcf8c45SMichael Gmelinwritten to the terminal (e.g., for debugging purposes).
771afe61c15SRodney W. Grimes.El
772afe61c15SRodney W. Grimes.Pp
773afe61c15SRodney W. GrimesThe
774afe61c15SRodney W. Grimes.Dv NL
775afe61c15SRodney W. Grimesand
776afe61c15SRodney W. Grimes.Dv CR
777afe61c15SRodney W. Grimescharacters cannot be changed.
778afe61c15SRodney W. GrimesThe values for all the remaining characters can be set and are
779afe61c15SRodney W. Grimesdescribed later in the document under
780afe61c15SRodney W. GrimesSpecial Control Characters.
781afe61c15SRodney W. Grimes.Pp
782afe61c15SRodney W. GrimesSpecial
783afe61c15SRodney W. Grimescharacter functions associated with changeable special control characters
784afe61c15SRodney W. Grimescan be disabled individually by setting their value to
785afe61c15SRodney W. Grimes.Dv {_POSIX_VDISABLE} ;
786afe61c15SRodney W. Grimessee
787afe61c15SRodney W. Grimes.Sx "Special Control Characters" .
788afe61c15SRodney W. Grimes.Pp
789afe61c15SRodney W. GrimesIf two or more special characters have the same value, the function
790afe61c15SRodney W. Grimesperformed when that character is received is undefined.
791afe61c15SRodney W. Grimes.Ss Modem Disconnect
792afe61c15SRodney W. GrimesIf a modem disconnect is detected by the terminal interface for a
793afe61c15SRodney W. Grimescontrolling terminal, and if
794afe61c15SRodney W. Grimes.Dv CLOCAL
795afe61c15SRodney W. Grimesis not set in the
796afe61c15SRodney W. Grimes.Fa c_cflag
797afe61c15SRodney W. Grimesfield for
798afe61c15SRodney W. Grimesthe terminal, the
799afe61c15SRodney W. Grimes.Dv SIGHUP
800afe61c15SRodney W. Grimessignal is sent to the controlling
801b5e7e999SRuslan Ermilovprocess associated with the terminal.
802b5e7e999SRuslan ErmilovUnless other arrangements have
803afe61c15SRodney W. Grimesbeen made, this causes the controlling process to terminate.
804edf0e5b3SMike PritchardAny subsequent call to the
805edf0e5b3SMike Pritchard.Fn read
806edf0e5b3SMike Pritchardfunction returns the value zero,
807b5e7e999SRuslan Ermilovindicating end of file.
808b5e7e999SRuslan ErmilovThus, processes that read a terminal
809afe61c15SRodney W. Grimesfile and test for end-of-file can terminate appropriately after a
810afe61c15SRodney W. Grimesdisconnect.
811afe61c15SRodney W. Grimes.\" If the
812afe61c15SRodney W. Grimes.\" .Er EIO
813afe61c15SRodney W. Grimes.\" condition specified in 6.1.1.4 that applies
814afe61c15SRodney W. Grimes.\" when the implementation supports job control also exists, it is
815afe61c15SRodney W. Grimes.\" unspecified whether the
816afe61c15SRodney W. Grimes.\" .Dv EOF
817afe61c15SRodney W. Grimes.\" condition or the
818afe61c15SRodney W. Grimes.\" .Pf [ Dv EIO
819afe61c15SRodney W. Grimes.\" ] is returned.
820afe61c15SRodney W. GrimesAny
821edf0e5b3SMike Pritchardsubsequent
822edf0e5b3SMike Pritchard.Fn write
823edf0e5b3SMike Pritchardto the terminal device returns -1, with
824afe61c15SRodney W. Grimes.Va errno
825afe61c15SRodney W. Grimesset to
826afe61c15SRodney W. Grimes.Er EIO ,
827afe61c15SRodney W. Grimesuntil the device is closed.
828afe61c15SRodney W. Grimes.Sh General Terminal Interface
829afe61c15SRodney W. Grimes.Ss Closing a Terminal Device File
830afe61c15SRodney W. GrimesThe last process to close a terminal device file causes any output
831b5e7e999SRuslan Ermilovto be sent to the device and any input to be discarded.
832b5e7e999SRuslan ErmilovThen, if
833afe61c15SRodney W. Grimes.Dv HUPCL
834afe61c15SRodney W. Grimesis set in the control modes, and the communications port supports a
835afe61c15SRodney W. Grimesdisconnect function, the terminal device performs a disconnect.
836afe61c15SRodney W. Grimes.Ss Parameters That Can Be Set
837afe61c15SRodney W. GrimesRoutines that need to control certain terminal
838afe61c15SRodney W. Grimes.Tn I/O
839afe61c15SRodney W. Grimescharacteristics
840afe61c15SRodney W. Grimesdo so by using the termios structure as defined in the header
841fe08efe6SRuslan Ermilov.In termios.h .
842afe61c15SRodney W. GrimesThis structure contains minimally four scalar elements of bit flags
843b5e7e999SRuslan Ermilovand one array of special characters.
844b5e7e999SRuslan ErmilovThe scalar flag elements are named:
845afe61c15SRodney W. Grimes.Fa c_iflag ,
846afe61c15SRodney W. Grimes.Fa c_oflag ,
847afe61c15SRodney W. Grimes.Fa c_cflag ,
848afe61c15SRodney W. Grimesand
849afe61c15SRodney W. Grimes.Fa c_lflag .
850afe61c15SRodney W. GrimesThe character array is named
851afe61c15SRodney W. Grimes.Fa c_cc ,
852afe61c15SRodney W. Grimesand its maximum index is
853afe61c15SRodney W. Grimes.Dv NCCS .
854afe61c15SRodney W. Grimes.Ss Input Modes
855afe61c15SRodney W. GrimesValues of the
856afe61c15SRodney W. Grimes.Fa c_iflag
857afe61c15SRodney W. Grimesfield describe the basic
858afe61c15SRodney W. Grimesterminal input control, and are composed of
859afe61c15SRodney W. Grimesfollowing masks:
860afe61c15SRodney W. Grimes.Pp
861afe61c15SRodney W. Grimes.Bl -tag -width IMAXBEL -offset indent -compact
862afe61c15SRodney W. Grimes.It Dv IGNBRK
863afe61c15SRodney W. Grimes/* ignore BREAK condition */
864afe61c15SRodney W. Grimes.It Dv BRKINT
865afe61c15SRodney W. Grimes/* map BREAK to SIGINTR */
866afe61c15SRodney W. Grimes.It Dv IGNPAR
867afe61c15SRodney W. Grimes/* ignore (discard) parity errors */
868afe61c15SRodney W. Grimes.It Dv PARMRK
869afe61c15SRodney W. Grimes/* mark parity and framing errors */
870afe61c15SRodney W. Grimes.It Dv INPCK
871afe61c15SRodney W. Grimes/* enable checking of parity errors */
872afe61c15SRodney W. Grimes.It Dv ISTRIP
873afe61c15SRodney W. Grimes/* strip 8th bit off chars */
874afe61c15SRodney W. Grimes.It Dv INLCR
875afe61c15SRodney W. Grimes/* map NL into CR */
876afe61c15SRodney W. Grimes.It Dv IGNCR
877afe61c15SRodney W. Grimes/* ignore CR */
878afe61c15SRodney W. Grimes.It Dv ICRNL
879afe61c15SRodney W. Grimes/* map CR to NL (ala CRMOD) */
880afe61c15SRodney W. Grimes.It Dv IXON
881afe61c15SRodney W. Grimes/* enable output flow control */
882afe61c15SRodney W. Grimes.It Dv IXOFF
883afe61c15SRodney W. Grimes/* enable input flow control */
884afe61c15SRodney W. Grimes.It Dv IXANY
885afe61c15SRodney W. Grimes/* any char will restart after stop */
886afe61c15SRodney W. Grimes.It Dv IMAXBEL
887afe61c15SRodney W. Grimes/* ring bell on input queue full */
888afe61c15SRodney W. Grimes.El
889afe61c15SRodney W. Grimes.Pp
890afe61c15SRodney W. GrimesIn the context of asynchronous serial data transmission, a break
891afe61c15SRodney W. Grimescondition is defined as a sequence of zero-valued bits that continues for
892b5e7e999SRuslan Ermilovmore than the time to send one byte.
893b5e7e999SRuslan ErmilovThe entire sequence of zero-valued
894afe61c15SRodney W. Grimesbits is interpreted as a single break condition, even if it continues for
895b5e7e999SRuslan Ermilova time equivalent to more than one byte.
896b5e7e999SRuslan ErmilovIn contexts other than
897afe61c15SRodney W. Grimesasynchronous serial data transmission the definition of a break condition
898afe61c15SRodney W. Grimesis implementation defined.
899afe61c15SRodney W. Grimes.Pp
900afe61c15SRodney W. GrimesIf
901afe61c15SRodney W. Grimes.Dv IGNBRK
902afe61c15SRodney W. Grimesis set, a break condition detected on input is ignored, that
903b5e7e999SRuslan Ermilovis, not put on the input queue and therefore not read by any process.
904b5e7e999SRuslan ErmilovIf
905afe61c15SRodney W. Grimes.Dv IGNBRK
906afe61c15SRodney W. Grimesis not set and
907afe61c15SRodney W. Grimes.Dv BRKINT
908afe61c15SRodney W. Grimesis set, the break condition flushes the
909afe61c15SRodney W. Grimesinput and output queues and if the terminal is the controlling terminal
910afe61c15SRodney W. Grimesof a foreground process group, the break condition generates a
911afe61c15SRodney W. Grimessingle
912afe61c15SRodney W. Grimes.Dv SIGINT
913b5e7e999SRuslan Ermilovsignal to that foreground process group.
914b5e7e999SRuslan ErmilovIf neither
915afe61c15SRodney W. Grimes.Dv IGNBRK
916afe61c15SRodney W. Grimesnor
917afe61c15SRodney W. Grimes.Dv BRKINT
918afe61c15SRodney W. Grimesis set, a break condition is read as a single
919afe61c15SRodney W. Grimes.Ql \&\e0 ,
920afe61c15SRodney W. Grimesor if
921afe61c15SRodney W. Grimes.Dv PARMRK
922afe61c15SRodney W. Grimesis set, as
923afe61c15SRodney W. Grimes.Ql \&\e377 ,
924afe61c15SRodney W. Grimes.Ql \&\e0 ,
925afe61c15SRodney W. Grimes.Ql \&\e0 .
926afe61c15SRodney W. Grimes.Pp
927afe61c15SRodney W. GrimesIf
928afe61c15SRodney W. Grimes.Dv IGNPAR
929afe61c15SRodney W. Grimesis set, a byte with a framing or parity error (other than
930afe61c15SRodney W. Grimesbreak) is ignored.
931afe61c15SRodney W. Grimes.Pp
932afe61c15SRodney W. GrimesIf
933afe61c15SRodney W. Grimes.Dv PARMRK
934afe61c15SRodney W. Grimesis set, and
935afe61c15SRodney W. Grimes.Dv IGNPAR
936afe61c15SRodney W. Grimesis not set, a byte with a framing or parity
937afe61c15SRodney W. Grimeserror (other than break) is given to the application as the
938afe61c15SRodney W. Grimesthree-character sequence
939afe61c15SRodney W. Grimes.Ql \&\e377 ,
940afe61c15SRodney W. Grimes.Ql \&\e0 ,
941afe61c15SRodney W. GrimesX, where
942afe61c15SRodney W. Grimes.Ql \&\e377 ,
943afe61c15SRodney W. Grimes.Ql \&\e0
944afe61c15SRodney W. Grimesis a two-character
945afe61c15SRodney W. Grimesflag preceding each sequence and X is the data of the character received
9465203edcdSRuslan Ermilovin error.
9475203edcdSRuslan ErmilovTo avoid ambiguity in this case, if
948afe61c15SRodney W. Grimes.Dv ISTRIP
949afe61c15SRodney W. Grimesis not set, a valid
950afe61c15SRodney W. Grimescharacter of
951afe61c15SRodney W. Grimes.Ql \&\e377
952afe61c15SRodney W. Grimesis given to the application as
953afe61c15SRodney W. Grimes.Ql \&\e377 ,
954afe61c15SRodney W. Grimes.Ql \&\e377 .
955afe61c15SRodney W. GrimesIf
956afe61c15SRodney W. Grimesneither
957afe61c15SRodney W. Grimes.Dv PARMRK
958afe61c15SRodney W. Grimesnor
959afe61c15SRodney W. Grimes.Dv IGNPAR
960afe61c15SRodney W. Grimesis set, a framing or parity error (other than
961afe61c15SRodney W. Grimesbreak) is given to the application as a single character
962afe61c15SRodney W. Grimes.Ql \&\e0 .
963afe61c15SRodney W. Grimes.Pp
964afe61c15SRodney W. GrimesIf
965afe61c15SRodney W. Grimes.Dv INPCK
966b5e7e999SRuslan Ermilovis set, input parity checking is enabled.
967b5e7e999SRuslan ErmilovIf
968afe61c15SRodney W. Grimes.Dv INPCK
969afe61c15SRodney W. Grimesis not set,
970afe61c15SRodney W. Grimesinput parity checking is disabled, allowing output parity generation
971b5e7e999SRuslan Ermilovwithout input parity errors.
972b5e7e999SRuslan ErmilovNote that whether input parity checking is
973afe61c15SRodney W. Grimesenabled or disabled is independent of whether parity detection is enabled
974afe61c15SRodney W. Grimesor disabled (see
975afe61c15SRodney W. Grimes.Sx "Control Modes" ) .
976afe61c15SRodney W. GrimesIf parity detection is enabled but input
977afe61c15SRodney W. Grimesparity checking is disabled, the hardware to which the terminal is
978afe61c15SRodney W. Grimesconnected recognizes the parity bit, but the terminal special file
979afe61c15SRodney W. Grimesdoes not check whether this bit is set correctly or not.
980afe61c15SRodney W. Grimes.Pp
981afe61c15SRodney W. GrimesIf
982afe61c15SRodney W. Grimes.Dv ISTRIP
983afe61c15SRodney W. Grimesis set, valid input bytes are first stripped to seven bits,
984afe61c15SRodney W. Grimesotherwise all eight bits are processed.
985afe61c15SRodney W. Grimes.Pp
986afe61c15SRodney W. GrimesIf
987afe61c15SRodney W. Grimes.Dv INLCR
988afe61c15SRodney W. Grimesis set, a received
989afe61c15SRodney W. Grimes.Dv NL
990afe61c15SRodney W. Grimescharacter is translated into a
991afe61c15SRodney W. Grimes.Dv CR
9925203edcdSRuslan Ermilovcharacter.
9935203edcdSRuslan ErmilovIf
994afe61c15SRodney W. Grimes.Dv IGNCR
995afe61c15SRodney W. Grimesis set, a received
996afe61c15SRodney W. Grimes.Dv CR
997afe61c15SRodney W. Grimescharacter is ignored (not
9985203edcdSRuslan Ermilovread).
9995203edcdSRuslan ErmilovIf
1000afe61c15SRodney W. Grimes.Dv IGNCR
1001afe61c15SRodney W. Grimesis not set and
1002afe61c15SRodney W. Grimes.Dv ICRNL
1003afe61c15SRodney W. Grimesis set, a received
1004afe61c15SRodney W. Grimes.Dv CR
1005afe61c15SRodney W. Grimescharacter is
1006afe61c15SRodney W. Grimestranslated into a
1007afe61c15SRodney W. Grimes.Dv NL
1008afe61c15SRodney W. Grimescharacter.
1009afe61c15SRodney W. Grimes.Pp
1010afe61c15SRodney W. GrimesIf
1011afe61c15SRodney W. Grimes.Dv IXON
1012b5e7e999SRuslan Ermilovis set, start/stop output control is enabled.
1013b5e7e999SRuslan ErmilovA received
1014afe61c15SRodney W. Grimes.Dv STOP
1015afe61c15SRodney W. Grimescharacter suspends output and a received
1016afe61c15SRodney W. Grimes.Dv START
1017afe61c15SRodney W. Grimescharacter
10186d249eeeSSheldon Hearnrestarts output.
10196d249eeeSSheldon HearnIf
1020afe61c15SRodney W. Grimes.Dv IXANY
1021afe61c15SRodney W. Grimesis also set, then any character may
10226d249eeeSSheldon Hearnrestart output.
10236d249eeeSSheldon HearnWhen
1024afe61c15SRodney W. Grimes.Dv IXON
1025afe61c15SRodney W. Grimesis set,
1026afe61c15SRodney W. Grimes.Dv START
1027afe61c15SRodney W. Grimesand
1028afe61c15SRodney W. Grimes.Dv STOP
1029afe61c15SRodney W. Grimescharacters are not
1030b5e7e999SRuslan Ermilovread, but merely perform flow control functions.
1031b5e7e999SRuslan ErmilovWhen
1032afe61c15SRodney W. Grimes.Dv IXON
1033afe61c15SRodney W. Grimesis not set,
1034afe61c15SRodney W. Grimesthe
1035afe61c15SRodney W. Grimes.Dv START
1036afe61c15SRodney W. Grimesand
1037afe61c15SRodney W. Grimes.Dv STOP
1038afe61c15SRodney W. Grimescharacters are read.
1039afe61c15SRodney W. Grimes.Pp
1040afe61c15SRodney W. GrimesIf
1041afe61c15SRodney W. Grimes.Dv IXOFF
1042b5e7e999SRuslan Ermilovis set, start/stop input control is enabled.
1043b5e7e999SRuslan ErmilovThe system shall transmit one or more
1044afe61c15SRodney W. Grimes.Dv STOP
1045afe61c15SRodney W. Grimescharacters, which are intended to cause the
1046afe61c15SRodney W. Grimesterminal device to stop transmitting data, as needed to prevent the input
1047afe61c15SRodney W. Grimesqueue from overflowing and causing the undefined behavior described in
1048afe61c15SRodney W. Grimes.Sx "Input Processing and Reading Data" ,
1049afe61c15SRodney W. Grimesand shall transmit one or more
1050afe61c15SRodney W. Grimes.Dv START
1051afe61c15SRodney W. Grimescharacters, which are
1052afe61c15SRodney W. Grimesintended to cause the terminal device to resume transmitting data, as
1053afe61c15SRodney W. Grimessoon as the device can continue transmitting data without risk of
1054b5e7e999SRuslan Ermilovoverflowing the input queue.
1055b5e7e999SRuslan ErmilovThe precise conditions under which
1056afe61c15SRodney W. Grimes.Dv STOP
1057afe61c15SRodney W. Grimesand
1058c2025a76SJoel Dahl.Dv START
1059afe61c15SRodney W. Grimescharacters are transmitted are implementation defined.
1060afe61c15SRodney W. Grimes.Pp
1061afe61c15SRodney W. GrimesIf
1062afe61c15SRodney W. Grimes.Dv IMAXBEL
1063afe61c15SRodney W. Grimesis set and the input queue is full, subsequent input shall cause an
1064afe61c15SRodney W. Grimes.Tn ASCII
1065afe61c15SRodney W. Grimes.Dv BEL
106643d1df33SAlexander Langercharacter to be transmitted to
1067afe61c15SRodney W. Grimesthe output queue.
1068afe61c15SRodney W. Grimes.Pp
1069edf0e5b3SMike PritchardThe initial input control value after
1070edf0e5b3SMike Pritchard.Fn open
1071edf0e5b3SMike Pritchardis implementation defined.
1072afe61c15SRodney W. Grimes.Ss Output Modes
1073afe61c15SRodney W. GrimesValues of the
1074afe61c15SRodney W. Grimes.Fa c_oflag
1075afe61c15SRodney W. Grimesfield describe the basic terminal output control,
1076afe61c15SRodney W. Grimesand are composed of the following masks:
1077afe61c15SRodney W. Grimes.Pp
1078bc093719SEd Schouten.Bl -tag -width ONOEOT -offset indent -compact
1079afe61c15SRodney W. Grimes.It Dv OPOST
1080afe61c15SRodney W. Grimes/* enable following output processing */
1081afe61c15SRodney W. Grimes.It Dv ONLCR
1082afe61c15SRodney W. Grimes/* map NL to CR-NL (ala
1083afe61c15SRodney W. Grimes.Dv CRMOD )
1084afe61c15SRodney W. Grimes*/
10853617ddfcSAssar Westerlund.It Dv OCRNL
10863617ddfcSAssar Westerlund/* map CR to NL */
1087bc093719SEd Schouten.It Dv TABDLY
1088bc093719SEd Schouten/* tab delay mask */
1089bc093719SEd Schouten.It Dv TAB0
1090bc093719SEd Schouten/* no tab delay and expansion */
1091bc093719SEd Schouten.It Dv TAB3
1092afe61c15SRodney W. Grimes/* expand tabs to spaces */
1093afe61c15SRodney W. Grimes.It Dv ONOEOT
1094afe61c15SRodney W. Grimes/* discard
1095afe61c15SRodney W. Grimes.Dv EOT Ns 's
1096afe61c15SRodney W. Grimes.Ql \&^D
1097afe61c15SRodney W. Grimeson output) */
10983617ddfcSAssar Westerlund.It Dv ONOCR
10993617ddfcSAssar Westerlund/* do not transmit CRs on column 0 */
11003617ddfcSAssar Westerlund.It Dv ONLRET
1101f87717faSMike Pritchard/* on the terminal NL performs the CR function */
1102afe61c15SRodney W. Grimes.El
1103afe61c15SRodney W. Grimes.Pp
1104afe61c15SRodney W. GrimesIf
1105afe61c15SRodney W. Grimes.Dv OPOST
1106afe61c15SRodney W. Grimesis set, the remaining flag masks are interpreted as follows;
1107afe61c15SRodney W. Grimesotherwise characters are transmitted without change.
1108afe61c15SRodney W. Grimes.Pp
1109afe61c15SRodney W. GrimesIf
1110afe61c15SRodney W. Grimes.Dv ONLCR
1111afe61c15SRodney W. Grimesis set, newlines are translated to carriage return, linefeeds.
1112afe61c15SRodney W. Grimes.Pp
1113afe61c15SRodney W. GrimesIf
11143617ddfcSAssar Westerlund.Dv OCRNL
11153617ddfcSAssar Westerlundis set, carriage returns are translated to newlines.
11163617ddfcSAssar Westerlund.Pp
1117bc093719SEd SchoutenThe
1118bc093719SEd Schouten.Dv TABDLY
1119bc093719SEd Schoutenbits specify the tab delay.
1120bc093719SEd SchoutenThe
1121bc093719SEd Schouten.Fa c_oflag
1122bc093719SEd Schoutenis masked with
1123bc093719SEd Schouten.Dv TABDLY
1124bc093719SEd Schoutenand compared with the
1125bc093719SEd Schoutenvalues
1126bc093719SEd Schouten.Dv TAB0
1127bc093719SEd Schoutenor
1128bc093719SEd Schouten.Dv TAB3 .
11293617ddfcSAssar WesterlundIf
1130bc093719SEd Schouten.Dv TAB3
1131afe61c15SRodney W. Grimesis set, tabs are expanded to the appropriate number of
1132afe61c15SRodney W. Grimesspaces (assuming 8 column tab stops).
1133afe61c15SRodney W. Grimes.Pp
1134afe61c15SRodney W. GrimesIf
1135afe61c15SRodney W. Grimes.Dv ONOEOT
1136afe61c15SRodney W. Grimesis set,
1137afe61c15SRodney W. Grimes.Tn ASCII
113868161b6bSRuslan Ermilov.Dv EOT Ns 's
1139afe61c15SRodney W. Grimesare discarded on output.
11403617ddfcSAssar Westerlund.Pp
11413617ddfcSAssar WesterlundIf
11423617ddfcSAssar Westerlund.Dv ONOCR
11433617ddfcSAssar Westerlundis set, no CR character is transmitted when at column 0 (first position).
11443617ddfcSAssar Westerlund.Pp
11453617ddfcSAssar WesterlundIf
11463617ddfcSAssar Westerlund.Dv ONLRET
11473617ddfcSAssar Westerlundis set, the NL character is assumed to do the carriage-return function;
11483617ddfcSAssar Westerlundthe column pointer will be set to 0.
1149afe61c15SRodney W. Grimes.Ss Control Modes
1150afe61c15SRodney W. GrimesValues of the
1151afe61c15SRodney W. Grimes.Fa c_cflag
1152afe61c15SRodney W. Grimesfield describe the basic
1153afe61c15SRodney W. Grimesterminal hardware control, and are composed of the
1154afe61c15SRodney W. Grimesfollowing masks.
1155afe61c15SRodney W. GrimesNot all values
1156afe61c15SRodney W. Grimesspecified are supported by all hardware.
1157afe61c15SRodney W. Grimes.Pp
1158afe61c15SRodney W. Grimes.Bl -tag -width CRTSXIFLOW -offset indent -compact
1159afe61c15SRodney W. Grimes.It Dv CSIZE
1160afe61c15SRodney W. Grimes/* character size mask */
1161afe61c15SRodney W. Grimes.It Dv CS5
1162afe61c15SRodney W. Grimes/* 5 bits (pseudo) */
1163afe61c15SRodney W. Grimes.It Dv CS6
1164afe61c15SRodney W. Grimes/* 6 bits */
1165afe61c15SRodney W. Grimes.It Dv CS7
1166afe61c15SRodney W. Grimes/* 7 bits */
1167afe61c15SRodney W. Grimes.It Dv CS8
1168afe61c15SRodney W. Grimes/* 8 bits */
1169afe61c15SRodney W. Grimes.It Dv CSTOPB
1170afe61c15SRodney W. Grimes/* send 2 stop bits */
1171afe61c15SRodney W. Grimes.It Dv CREAD
1172afe61c15SRodney W. Grimes/* enable receiver */
1173afe61c15SRodney W. Grimes.It Dv PARENB
1174afe61c15SRodney W. Grimes/* parity enable */
1175afe61c15SRodney W. Grimes.It Dv PARODD
1176afe61c15SRodney W. Grimes/* odd parity, else even */
1177afe61c15SRodney W. Grimes.It Dv HUPCL
1178afe61c15SRodney W. Grimes/* hang up on last close */
1179afe61c15SRodney W. Grimes.It Dv CLOCAL
1180afe61c15SRodney W. Grimes/* ignore modem status lines */
1181afe61c15SRodney W. Grimes.It Dv CCTS_OFLOW
1182afe61c15SRodney W. Grimes/*
1183afe61c15SRodney W. Grimes.Dv CTS
1184afe61c15SRodney W. Grimesflow control of output */
1185afe61c15SRodney W. Grimes.It Dv CRTSCTS
1186afe61c15SRodney W. Grimes/* same as
1187afe61c15SRodney W. Grimes.Dv CCTS_OFLOW
1188afe61c15SRodney W. Grimes*/
1189afe61c15SRodney W. Grimes.It Dv CRTS_IFLOW
1190afe61c15SRodney W. Grimes/* RTS flow control of input */
1191afe61c15SRodney W. Grimes.It Dv MDMBUF
1192afe61c15SRodney W. Grimes/* flow control output via Carrier */
1193705aad98SStephen Hurd.It Dv CNO_RTSDTR
1194705aad98SStephen Hurd/* Do not assert RTS or DTR automatically */
1195afe61c15SRodney W. Grimes.El
1196afe61c15SRodney W. Grimes.Pp
1197afe61c15SRodney W. GrimesThe
1198afe61c15SRodney W. Grimes.Dv CSIZE
1199afe61c15SRodney W. Grimesbits specify the byte size in bits for both transmission and
1200b5e7e999SRuslan Ermilovreception.
1201b5e7e999SRuslan ErmilovThe
1202afe61c15SRodney W. Grimes.Fa c_cflag
1203afe61c15SRodney W. Grimesis masked with
1204afe61c15SRodney W. Grimes.Dv CSIZE
1205afe61c15SRodney W. Grimesand compared with the
1206afe61c15SRodney W. Grimesvalues
1207afe61c15SRodney W. Grimes.Dv CS5 ,
1208afe61c15SRodney W. Grimes.Dv CS6 ,
1209afe61c15SRodney W. Grimes.Dv CS7 ,
1210afe61c15SRodney W. Grimesor
1211afe61c15SRodney W. Grimes.Dv CS8 .
1212b5e7e999SRuslan ErmilovThis size does not include the parity bit, if any.
1213b5e7e999SRuslan ErmilovIf
1214afe61c15SRodney W. Grimes.Dv CSTOPB
1215b5e7e999SRuslan Ermilovis set, two stop bits are used, otherwise one stop bit.
1216b5e7e999SRuslan ErmilovFor example, at 110 baud, two stop bits are normally used.
1217afe61c15SRodney W. Grimes.Pp
1218afe61c15SRodney W. GrimesIf
1219afe61c15SRodney W. Grimes.Dv CREAD
1220b5e7e999SRuslan Ermilovis set, the receiver is enabled.
1221b5e7e999SRuslan ErmilovOtherwise, no character is received.
1222b5e7e999SRuslan ErmilovNot all hardware supports this bit.
1223b5e7e999SRuslan ErmilovIn fact, this flag is pretty silly and if it were not part of the
12244b66483fSRuslan Ermilov.Nm
1225afe61c15SRodney W. Grimesspecification
1226afe61c15SRodney W. Grimesit would be omitted.
1227afe61c15SRodney W. Grimes.Pp
1228afe61c15SRodney W. GrimesIf
1229afe61c15SRodney W. Grimes.Dv PARENB
1230afe61c15SRodney W. Grimesis set, parity generation and detection are enabled and a parity
1231b5e7e999SRuslan Ermilovbit is added to each character.
1232b5e7e999SRuslan ErmilovIf parity is enabled,
1233afe61c15SRodney W. Grimes.Dv PARODD
1234afe61c15SRodney W. Grimesspecifies
1235afe61c15SRodney W. Grimesodd parity if set, otherwise even parity is used.
1236afe61c15SRodney W. Grimes.Pp
1237afe61c15SRodney W. GrimesIf
1238afe61c15SRodney W. Grimes.Dv HUPCL
1239afe61c15SRodney W. Grimesis set, the modem control lines for the port are lowered
1240afe61c15SRodney W. Grimeswhen the last process with the port open closes the port or the process
1241b5e7e999SRuslan Ermilovterminates.
1242b5e7e999SRuslan ErmilovThe modem connection is broken.
1243afe61c15SRodney W. Grimes.Pp
1244afe61c15SRodney W. GrimesIf
1245afe61c15SRodney W. Grimes.Dv CLOCAL
1246afe61c15SRodney W. Grimesis set, a connection does not depend on the state of the modem
1247b5e7e999SRuslan Ermilovstatus lines.
1248b5e7e999SRuslan ErmilovIf
1249afe61c15SRodney W. Grimes.Dv CLOCAL
1250afe61c15SRodney W. Grimesis clear, the modem status lines are
1251afe61c15SRodney W. Grimesmonitored.
1252afe61c15SRodney W. Grimes.Pp
1253edf0e5b3SMike PritchardUnder normal circumstances, a call to the
1254edf0e5b3SMike Pritchard.Fn open
1255edf0e5b3SMike Pritchardfunction waits for
1256b5e7e999SRuslan Ermilovthe modem connection to complete.
1257b5e7e999SRuslan ErmilovHowever, if the
1258afe61c15SRodney W. Grimes.Dv O_NONBLOCK
1259afe61c15SRodney W. Grimesflag is set
1260afe61c15SRodney W. Grimesor if
1261afe61c15SRodney W. Grimes.Dv CLOCAL
1262edf0e5b3SMike Pritchardhas been set, the
1263edf0e5b3SMike Pritchard.Fn open
1264edf0e5b3SMike Pritchardfunction returns
1265afe61c15SRodney W. Grimesimmediately without waiting for the connection.
1266afe61c15SRodney W. Grimes.Pp
1267afe61c15SRodney W. GrimesThe
1268afe61c15SRodney W. Grimes.Dv CCTS_OFLOW
1269afe61c15SRodney W. Grimes.Pf ( Dv CRTSCTS )
1270afe61c15SRodney W. Grimesflag is currently unused.
1271afe61c15SRodney W. Grimes.Pp
1272afe61c15SRodney W. GrimesIf
1273afe61c15SRodney W. Grimes.Dv MDMBUF
1274afe61c15SRodney W. Grimesis set then output flow control is controlled by the state
1275afe61c15SRodney W. Grimesof Carrier Detect.
1276afe61c15SRodney W. Grimes.Pp
1277705aad98SStephen HurdIf
1278705aad98SStephen Hurd.Dv CNO_RTSDTR
1279705aad98SStephen Hurdis set then the RTS and DTR lines will not be asserted when the device
1280705aad98SStephen Hurdis opened.
1281705aad98SStephen HurdAs a result, this flag is only useful on initial-state devices.
1282705aad98SStephen Hurd.Pp
1283afe61c15SRodney W. GrimesIf the object for which the control modes are set is not an asynchronous
1284afe61c15SRodney W. Grimesserial connection, some of the modes may be ignored; for example, if an
1285afe61c15SRodney W. Grimesattempt is made to set the baud rate on a network connection to a
1286afe61c15SRodney W. Grimesterminal on another host, the baud rate may or may not be set on the
1287afe61c15SRodney W. Grimesconnection between that terminal and the machine it is directly connected
1288afe61c15SRodney W. Grimesto.
1289afe61c15SRodney W. Grimes.Ss Local Modes
1290afe61c15SRodney W. GrimesValues of the
1291afe61c15SRodney W. Grimes.Fa c_lflag
1292afe61c15SRodney W. Grimesfield describe the control of
1293afe61c15SRodney W. Grimesvarious functions, and are composed of the following
1294afe61c15SRodney W. Grimesmasks.
1295afe61c15SRodney W. Grimes.Pp
1296afe61c15SRodney W. Grimes.Bl -tag -width NOKERNINFO -offset indent -compact
1297afe61c15SRodney W. Grimes.It Dv ECHOKE
1298afe61c15SRodney W. Grimes/* visual erase for line kill */
1299afe61c15SRodney W. Grimes.It Dv ECHOE
1300afe61c15SRodney W. Grimes/* visually erase chars */
1301afe61c15SRodney W. Grimes.It Dv ECHO
1302afe61c15SRodney W. Grimes/* enable echoing */
1303afe61c15SRodney W. Grimes.It Dv ECHONL
1304afe61c15SRodney W. Grimes/* echo
1305afe61c15SRodney W. Grimes.Dv NL
1306afe61c15SRodney W. Grimeseven if
1307afe61c15SRodney W. Grimes.Dv ECHO
1308afe61c15SRodney W. Grimesis off */
1309afe61c15SRodney W. Grimes.It Dv ECHOPRT
1310afe61c15SRodney W. Grimes/* visual erase mode for hardcopy */
1311afe61c15SRodney W. Grimes.It Dv ECHOCTL
1312afe61c15SRodney W. Grimes/* echo control chars as ^(Char) */
1313afe61c15SRodney W. Grimes.It Dv ISIG
1314afe61c15SRodney W. Grimes/* enable signals
1315afe61c15SRodney W. Grimes.Dv INTR ,
1316afe61c15SRodney W. Grimes.Dv QUIT ,
1317afe61c15SRodney W. Grimes.Dv [D]SUSP
1318afe61c15SRodney W. Grimes*/
1319afe61c15SRodney W. Grimes.It Dv ICANON
1320afe61c15SRodney W. Grimes/* canonicalize input lines */
1321afe61c15SRodney W. Grimes.It Dv ALTWERASE
1322afe61c15SRodney W. Grimes/* use alternate
1323afe61c15SRodney W. Grimes.Dv WERASE
1324afe61c15SRodney W. Grimesalgorithm */
1325afe61c15SRodney W. Grimes.It Dv IEXTEN
1326afe61c15SRodney W. Grimes/* enable
1327afe61c15SRodney W. Grimes.Dv DISCARD
1328afe61c15SRodney W. Grimesand
1329afe61c15SRodney W. Grimes.Dv LNEXT
1330afe61c15SRodney W. Grimes*/
1331afe61c15SRodney W. Grimes.It Dv EXTPROC
1332afe61c15SRodney W. Grimes/* external processing */
1333afe61c15SRodney W. Grimes.It Dv TOSTOP
1334afe61c15SRodney W. Grimes/* stop background jobs from output */
1335afe61c15SRodney W. Grimes.It Dv FLUSHO
1336afe61c15SRodney W. Grimes/* output being flushed (state) */
1337afe61c15SRodney W. Grimes.It Dv NOKERNINFO
1338afe61c15SRodney W. Grimes/* no kernel output from
1339afe61c15SRodney W. Grimes.Dv VSTATUS
1340afe61c15SRodney W. Grimes*/
1341afe61c15SRodney W. Grimes.It Dv PENDIN
1342afe61c15SRodney W. Grimes/* XXX retype pending input (state) */
1343afe61c15SRodney W. Grimes.It Dv NOFLSH
1344afe61c15SRodney W. Grimes/* don't flush after interrupt */
1345afe61c15SRodney W. Grimes.El
1346afe61c15SRodney W. Grimes.Pp
1347afe61c15SRodney W. GrimesIf
1348afe61c15SRodney W. Grimes.Dv ECHO
1349b5e7e999SRuslan Ermilovis set, input characters are echoed back to the terminal.
1350b5e7e999SRuslan ErmilovIf
1351afe61c15SRodney W. Grimes.Dv ECHO
1352afe61c15SRodney W. Grimesis not set, input characters are not echoed.
1353afe61c15SRodney W. Grimes.Pp
1354afe61c15SRodney W. GrimesIf
1355afe61c15SRodney W. Grimes.Dv ECHOE
1356afe61c15SRodney W. Grimesand
1357afe61c15SRodney W. Grimes.Dv ICANON
1358afe61c15SRodney W. Grimesare set, the
1359afe61c15SRodney W. Grimes.Dv ERASE
1360afe61c15SRodney W. Grimescharacter causes the terminal
1361afe61c15SRodney W. Grimesto erase the last character in the current line from the display, if
1362b5e7e999SRuslan Ermilovpossible.
1363b5e7e999SRuslan ErmilovIf there is no character to erase, an implementation may echo
1364afe61c15SRodney W. Grimesan indication that this was the case or do nothing.
1365afe61c15SRodney W. Grimes.Pp
1366afe61c15SRodney W. GrimesIf
1367afe61c15SRodney W. Grimes.Dv ECHOK
1368afe61c15SRodney W. Grimesand
1369afe61c15SRodney W. Grimes.Dv ICANON
1370afe61c15SRodney W. Grimesare set, the
1371afe61c15SRodney W. Grimes.Dv KILL
1372afe61c15SRodney W. Grimescharacter causes
1373afe61c15SRodney W. Grimesthe current line to be discarded and the system echoes the
1374afe61c15SRodney W. Grimes.Ql \&\en
1375afe61c15SRodney W. Grimescharacter after the
1376afe61c15SRodney W. Grimes.Dv KILL
1377afe61c15SRodney W. Grimescharacter.
1378afe61c15SRodney W. Grimes.Pp
1379afe61c15SRodney W. GrimesIf
1380afe61c15SRodney W. Grimes.Dv ECHOKE
1381afe61c15SRodney W. Grimesand
1382afe61c15SRodney W. Grimes.Dv ICANON
1383afe61c15SRodney W. Grimesare set, the
1384afe61c15SRodney W. Grimes.Dv KILL
1385afe61c15SRodney W. Grimescharacter causes
1386afe61c15SRodney W. Grimesthe current line to be discarded and the system causes
1387afe61c15SRodney W. Grimesthe terminal
1388afe61c15SRodney W. Grimesto erase the line from the display.
1389afe61c15SRodney W. Grimes.Pp
1390afe61c15SRodney W. GrimesIf
1391afe61c15SRodney W. Grimes.Dv ECHOPRT
1392afe61c15SRodney W. Grimesand
1393afe61c15SRodney W. Grimes.Dv ICANON
1394afe61c15SRodney W. Grimesare set, the system assumes
1395afe61c15SRodney W. Grimesthat the display is a printing device and prints a
1396afe61c15SRodney W. Grimesbackslash and the erased characters when processing
1397afe61c15SRodney W. Grimes.Dv ERASE
1398afe61c15SRodney W. Grimescharacters, followed by a forward slash.
1399afe61c15SRodney W. Grimes.Pp
1400afe61c15SRodney W. GrimesIf
1401afe61c15SRodney W. Grimes.Dv ECHOCTL
1402afe61c15SRodney W. Grimesis set, the system echoes control characters
1403afe61c15SRodney W. Grimesin a visible fashion using a caret followed by the control character.
1404afe61c15SRodney W. Grimes.Pp
1405afe61c15SRodney W. GrimesIf
1406afe61c15SRodney W. Grimes.Dv ALTWERASE
1407afe61c15SRodney W. Grimesis set, the system uses an alternative algorithm
1408afe61c15SRodney W. Grimesfor determining what constitutes a word when processing
1409afe61c15SRodney W. Grimes.Dv WERASE
1410afe61c15SRodney W. Grimescharacters (see
1411afe61c15SRodney W. Grimes.Dv WERASE ) .
1412afe61c15SRodney W. Grimes.Pp
1413afe61c15SRodney W. GrimesIf
1414afe61c15SRodney W. Grimes.Dv ECHONL
1415afe61c15SRodney W. Grimesand
1416afe61c15SRodney W. Grimes.Dv ICANON
1417afe61c15SRodney W. Grimesare set, the
1418afe61c15SRodney W. Grimes.Ql \&\en
1419afe61c15SRodney W. Grimescharacter echoes even if
1420afe61c15SRodney W. Grimes.Dv ECHO
1421afe61c15SRodney W. Grimesis not set.
1422afe61c15SRodney W. Grimes.Pp
1423afe61c15SRodney W. GrimesIf
1424afe61c15SRodney W. Grimes.Dv ICANON
1425b5e7e999SRuslan Ermilovis set, canonical processing is enabled.
1426b5e7e999SRuslan ErmilovThis enables the
1427afe61c15SRodney W. Grimeserase and kill edit functions, and the assembly of input characters into
1428afe61c15SRodney W. Grimeslines delimited by
1429afe61c15SRodney W. Grimes.Dv NL ,
1430afe61c15SRodney W. Grimes.Dv EOF ,
1431afe61c15SRodney W. Grimesand
1432afe61c15SRodney W. Grimes.Dv EOL ,
1433afe61c15SRodney W. Grimesas described in
1434afe61c15SRodney W. Grimes.Sx "Canonical Mode Input Processing" .
1435afe61c15SRodney W. Grimes.Pp
1436afe61c15SRodney W. GrimesIf
1437afe61c15SRodney W. Grimes.Dv ICANON
1438afe61c15SRodney W. Grimesis not set, read requests are satisfied directly from the input
1439b5e7e999SRuslan Ermilovqueue.
1440b5e7e999SRuslan ErmilovA read is not satisfied until at least
14415f1376d7SMike Pritchard.Dv MIN
1442afe61c15SRodney W. Grimesbytes have been
1443afe61c15SRodney W. Grimesreceived or the timeout value
14445f1376d7SMike Pritchard.Dv TIME
1445b5e7e999SRuslan Ermilovexpired between bytes.
1446b5e7e999SRuslan ErmilovThe time value
14475203edcdSRuslan Ermilovrepresents tenths of seconds.
14485203edcdSRuslan ErmilovSee
1449afe61c15SRodney W. Grimes.Sx "Noncanonical Mode Input Processing"
1450afe61c15SRodney W. Grimesfor more details.
1451afe61c15SRodney W. Grimes.Pp
1452afe61c15SRodney W. GrimesIf
1453afe61c15SRodney W. Grimes.Dv ISIG
1454afe61c15SRodney W. Grimesis set, each input character is checked against the special
1455afe61c15SRodney W. Grimescontrol characters
1456afe61c15SRodney W. Grimes.Dv INTR ,
1457afe61c15SRodney W. Grimes.Dv QUIT ,
1458afe61c15SRodney W. Grimesand
1459afe61c15SRodney W. Grimes.Dv SUSP
1460b5e7e999SRuslan Ermilov(job control only).
1461b5e7e999SRuslan ErmilovIf an input
1462afe61c15SRodney W. Grimescharacter matches one of these control characters, the function
1463b5e7e999SRuslan Ermilovassociated with that character is performed.
1464b5e7e999SRuslan ErmilovIf
1465afe61c15SRodney W. Grimes.Dv ISIG
1466afe61c15SRodney W. Grimesis not set, no
1467b5e7e999SRuslan Ermilovchecking is done.
1468b5e7e999SRuslan ErmilovThus these special input functions are possible only
1469afe61c15SRodney W. Grimesif
1470afe61c15SRodney W. Grimes.Dv ISIG
1471afe61c15SRodney W. Grimesis set.
1472afe61c15SRodney W. Grimes.Pp
1473afe61c15SRodney W. GrimesIf
1474afe61c15SRodney W. Grimes.Dv IEXTEN
1475afe61c15SRodney W. Grimesis set, implementation-defined functions are recognized
1476b5e7e999SRuslan Ermilovfrom the input data.
1477b5e7e999SRuslan ErmilovHow
1478afe61c15SRodney W. Grimes.Dv IEXTEN
1479afe61c15SRodney W. Grimesbeing set
1480afe61c15SRodney W. Grimesinteracts with
1481afe61c15SRodney W. Grimes.Dv ICANON ,
1482afe61c15SRodney W. Grimes.Dv ISIG ,
1483afe61c15SRodney W. Grimes.Dv IXON ,
1484afe61c15SRodney W. Grimesor
1485afe61c15SRodney W. Grimes.Dv IXOFF
1486afe61c15SRodney W. Grimesis implementation defined.
1487afe61c15SRodney W. GrimesIf
1488afe61c15SRodney W. Grimes.Dv IEXTEN
1489afe61c15SRodney W. Grimesis not set, then
1490afe61c15SRodney W. Grimesimplementation-defined functions are not recognized, and the
1491afe61c15SRodney W. Grimescorresponding input characters are not processed as described for
1492afe61c15SRodney W. Grimes.Dv ICANON ,
1493afe61c15SRodney W. Grimes.Dv ISIG ,
1494afe61c15SRodney W. Grimes.Dv IXON ,
1495afe61c15SRodney W. Grimesand
1496afe61c15SRodney W. Grimes.Dv IXOFF .
1497afe61c15SRodney W. Grimes.Pp
1498afe61c15SRodney W. GrimesIf
1499afe61c15SRodney W. Grimes.Dv NOFLSH
1500afe61c15SRodney W. Grimesis set, the normal flush of the input and output queues
1501afe61c15SRodney W. Grimesassociated with the
1502afe61c15SRodney W. Grimes.Dv INTR ,
1503afe61c15SRodney W. Grimes.Dv QUIT ,
1504afe61c15SRodney W. Grimesand
1505afe61c15SRodney W. Grimes.Dv SUSP
1506afe61c15SRodney W. Grimescharacters
1507afe61c15SRodney W. Grimesare not be done.
1508afe61c15SRodney W. Grimes.Pp
1509afe61c15SRodney W. GrimesIf
1510afe61c15SRodney W. Grimes.Dv TOSTOP
1511afe61c15SRodney W. Grimesis set, the signal
1512afe61c15SRodney W. Grimes.Dv SIGTTOU
1513afe61c15SRodney W. Grimesis sent to the process group of a process that tries to write to
1514afe61c15SRodney W. Grimesits controlling terminal if it is not in the foreground process group for
1515b5e7e999SRuslan Ermilovthat terminal.
1516b5e7e999SRuslan ErmilovThis signal, by default, stops the members of the process group.
1517b5e7e999SRuslan ErmilovOtherwise, the output generated by that process is output to the
1518b5e7e999SRuslan Ermilovcurrent output stream.
1519b5e7e999SRuslan ErmilovProcesses that are blocking or ignoring
1520afe61c15SRodney W. Grimes.Dv SIGTTOU
1521afe61c15SRodney W. Grimessignals are excepted and allowed to produce output and the
1522afe61c15SRodney W. Grimes.Dv SIGTTOU
1523afe61c15SRodney W. Grimessignal
1524afe61c15SRodney W. Grimesis not sent.
1525afe61c15SRodney W. Grimes.Pp
1526afe61c15SRodney W. GrimesIf
1527afe61c15SRodney W. Grimes.Dv NOKERNINFO
1528afe61c15SRodney W. Grimesis set, the kernel does not produce a status message
1529afe61c15SRodney W. Grimeswhen processing
1530afe61c15SRodney W. Grimes.Dv STATUS
1531afe61c15SRodney W. Grimescharacters (see
1532afe61c15SRodney W. Grimes.Dv STATUS ) .
1533afe61c15SRodney W. Grimes.Ss Special Control Characters
1534afe61c15SRodney W. GrimesThe special control characters values are defined by the array
1535afe61c15SRodney W. Grimes.Fa c_cc .
1536afe61c15SRodney W. GrimesThis table lists the array index, the corresponding special character,
1537b5e7e999SRuslan Ermilovand the system default value.
1538b5e7e999SRuslan ErmilovFor an accurate list of
1539afe61c15SRodney W. Grimesthe system defaults, consult the header file
15400ad02507SRemko Lodder.In sys/ttydefaults.h .
1541afe61c15SRodney W. Grimes.Pp
1542afe61c15SRodney W. Grimes.Bl -column "Index Name" "Special Character" -offset indent -compact
1543afe61c15SRodney W. Grimes.It Em "Index Name	Special Character	Default Value"
1544afe61c15SRodney W. Grimes.It Dv VEOF Ta EOF Ta \&^D
1545afe61c15SRodney W. Grimes.It Dv VEOL Ta EOL Ta _POSIX_VDISABLE
1546afe61c15SRodney W. Grimes.It Dv VEOL2 Ta EOL2 Ta _POSIX_VDISABLE
1547afe61c15SRodney W. Grimes.It Dv VERASE Ta ERASE Ta \&^? Ql \&\e177
1548afe61c15SRodney W. Grimes.It Dv VWERASE Ta WERASE Ta \&^W
1549afe61c15SRodney W. Grimes.It Dv VKILL Ta KILL Ta \&^U
1550afe61c15SRodney W. Grimes.It Dv VREPRINT Ta REPRINT Ta \&^R
1551afe61c15SRodney W. Grimes.It Dv VINTR Ta INTR Ta \&^C
1552afe61c15SRodney W. Grimes.It Dv VQUIT Ta QUIT Ta \&^\e\e Ql \&\e34
1553afe61c15SRodney W. Grimes.It Dv VSUSP Ta SUSP Ta \&^Z
1554afe61c15SRodney W. Grimes.It Dv VDSUSP Ta DSUSP Ta \&^Y
1555afe61c15SRodney W. Grimes.It Dv VSTART Ta START Ta \&^Q
1556afe61c15SRodney W. Grimes.It Dv VSTOP Ta STOP Ta \&^S
1557afe61c15SRodney W. Grimes.It Dv VLNEXT Ta LNEXT Ta \&^V
1558afe61c15SRodney W. Grimes.It Dv VDISCARD Ta DISCARD Ta \&^O
1559afe61c15SRodney W. Grimes.It Dv VMIN Ta --- Ta \&1
1560afe61c15SRodney W. Grimes.It Dv VTIME Ta --- Ta \&0
1561afe61c15SRodney W. Grimes.It Dv VSTATUS Ta STATUS Ta \&^T
1562afe61c15SRodney W. Grimes.El
1563afe61c15SRodney W. Grimes.Pp
1564afe61c15SRodney W. GrimesIf the
1565afe61c15SRodney W. Grimesvalue of one of the changeable special control characters (see
1566afe61c15SRodney W. Grimes.Sx "Special Characters" )
1567afe61c15SRodney W. Grimesis
1568afe61c15SRodney W. Grimes.Dv {_POSIX_VDISABLE} ,
1569afe61c15SRodney W. Grimesthat function is disabled; that is, no input
1570afe61c15SRodney W. Grimesdata is recognized as the disabled special character.
1571afe61c15SRodney W. GrimesIf
1572afe61c15SRodney W. Grimes.Dv ICANON
1573afe61c15SRodney W. Grimesis
1574afe61c15SRodney W. Grimesnot set, the value of
1575afe61c15SRodney W. Grimes.Dv {_POSIX_VDISABLE}
1576afe61c15SRodney W. Grimeshas no special meaning for the
1577afe61c15SRodney W. Grimes.Dv VMIN
1578afe61c15SRodney W. Grimesand
1579afe61c15SRodney W. Grimes.Dv VTIME
1580afe61c15SRodney W. Grimesentries of the
1581afe61c15SRodney W. Grimes.Fa c_cc
1582afe61c15SRodney W. Grimesarray.
1583afe61c15SRodney W. Grimes.Pp
1584afe61c15SRodney W. GrimesThe initial values of the flags and control characters
1585edf0e5b3SMike Pritchardafter
1586edf0e5b3SMike Pritchard.Fn open
1587edf0e5b3SMike Pritchardis set according to
1588afe61c15SRodney W. Grimesthe values in the header
1589fe08efe6SRuslan Ermilov.In sys/ttydefaults.h .
15901f83b37eSEdward Tomasz Napierala.Sh SEE ALSO
15911f83b37eSEdward Tomasz Napierala.Xr stty 1 ,
15921f83b37eSEdward Tomasz Napierala.Xr tcgetsid 3 ,
15931f83b37eSEdward Tomasz Napierala.Xr tcsendbreak 3 ,
15941f83b37eSEdward Tomasz Napierala.Xr tcsetattr 3 ,
15951f83b37eSEdward Tomasz Napierala.Xr tcsetsid 3 ,
1596*2dcf8c45SMichael Gmelin.Xr tty 4 ,
1597*2dcf8c45SMichael Gmelin.Xr stack 9
1598