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