xref: /xnu-10002.41.9/bsd/man/man4/tty.4 (revision 699cd48037512bf4380799317ca44ca453c82f57)
1*699cd480SApple OSS Distributions.\" Copyright (c) 1991, 1992, 1993
2*699cd480SApple OSS Distributions.\"	The Regents of the University of California.  All rights reserved.
3*699cd480SApple OSS Distributions.\"
4*699cd480SApple OSS Distributions.\" Redistribution and use in source and binary forms, with or without
5*699cd480SApple OSS Distributions.\" modification, are permitted provided that the following conditions
6*699cd480SApple OSS Distributions.\" are met:
7*699cd480SApple OSS Distributions.\" 1. Redistributions of source code must retain the above copyright
8*699cd480SApple OSS Distributions.\"    notice, this list of conditions and the following disclaimer.
9*699cd480SApple OSS Distributions.\" 2. Redistributions in binary form must reproduce the above copyright
10*699cd480SApple OSS Distributions.\"    notice, this list of conditions and the following disclaimer in the
11*699cd480SApple OSS Distributions.\"    documentation and/or other materials provided with the distribution.
12*699cd480SApple OSS Distributions.\" 3. All advertising materials mentioning features or use of this software
13*699cd480SApple OSS Distributions.\"    must display the following acknowledgement:
14*699cd480SApple OSS Distributions.\"	This product includes software developed by the University of
15*699cd480SApple OSS Distributions.\"	California, Berkeley and its contributors.
16*699cd480SApple OSS Distributions.\" 4. Neither the name of the University nor the names of its contributors
17*699cd480SApple OSS Distributions.\"    may be used to endorse or promote products derived from this software
18*699cd480SApple OSS Distributions.\"    without specific prior written permission.
19*699cd480SApple OSS Distributions.\"
20*699cd480SApple OSS Distributions.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21*699cd480SApple OSS Distributions.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*699cd480SApple OSS Distributions.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*699cd480SApple OSS Distributions.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24*699cd480SApple OSS Distributions.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25*699cd480SApple OSS Distributions.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26*699cd480SApple OSS Distributions.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27*699cd480SApple OSS Distributions.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28*699cd480SApple OSS Distributions.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29*699cd480SApple OSS Distributions.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30*699cd480SApple OSS Distributions.\" SUCH DAMAGE.
31*699cd480SApple OSS Distributions.\"
32*699cd480SApple OSS Distributions.\"     @(#)tty.4	8.3 (Berkeley) 4/19/94
33*699cd480SApple OSS Distributions.\"	$FreeBSD$
34*699cd480SApple OSS Distributions.\"
35*699cd480SApple OSS Distributions.Dd August 14, 1992
36*699cd480SApple OSS Distributions.Dt TTY 4
37*699cd480SApple OSS Distributions.Os BSD 4
38*699cd480SApple OSS Distributions.Sh NAME
39*699cd480SApple OSS Distributions.Nm tty
40*699cd480SApple OSS Distributions.Nd general terminal interface
41*699cd480SApple OSS Distributions.Sh SYNOPSIS
42*699cd480SApple OSS Distributions.Fd #include <sys/ioctl.h>
43*699cd480SApple OSS Distributions.Sh DESCRIPTION
44*699cd480SApple OSS DistributionsThis section describes the interface to the terminal drivers
45*699cd480SApple OSS Distributionsin the system.
46*699cd480SApple OSS Distributions.Ss Terminal Special Files
47*699cd480SApple OSS DistributionsEach hardware terminal port on the system usually has a terminal special device
48*699cd480SApple OSS Distributionsfile associated with it in the directory ``/dev/'' (for
49*699cd480SApple OSS Distributionsexample, ``/dev/tty03'').
50*699cd480SApple OSS DistributionsWhen a user logs into
51*699cd480SApple OSS Distributionsthe system on one of these hardware terminal ports, the system has already
52*699cd480SApple OSS Distributionsopened the associated device and prepared the line for normal interactive
53*699cd480SApple OSS Distributionsuse (see
54*699cd480SApple OSS Distributions.Xr getty 8 .)
55*699cd480SApple OSS DistributionsThere is also a special case of a terminal file that connects not to
56*699cd480SApple OSS Distributionsa hardware terminal port, but to another program on the other side.
57*699cd480SApple OSS DistributionsThese special terminal devices are called
58*699cd480SApple OSS Distributions.Em ptys
59*699cd480SApple OSS Distributionsand provide the mechanism necessary to give users the same interface to the
60*699cd480SApple OSS Distributionssystem when logging in over a network (using
61*699cd480SApple OSS Distributions.Xr rlogin 1 ,
62*699cd480SApple OSS Distributionsor
63*699cd480SApple OSS Distributions.Xr telnet 1
64*699cd480SApple OSS Distributionsfor example).  Even in these cases the details of how the terminal
65*699cd480SApple OSS Distributionsfile was opened and set up is already handled by special software
66*699cd480SApple OSS Distributionsin the system.
67*699cd480SApple OSS DistributionsThus, users do not normally need to worry about the details of
68*699cd480SApple OSS Distributionshow these lines are opened or used.  Also, these lines are often used
69*699cd480SApple OSS Distributionsfor dialing out of a system (through an out-calling modem), but again
70*699cd480SApple OSS Distributionsthe system provides programs that hide the details of accessing
71*699cd480SApple OSS Distributionsthese terminal special files (see
72*699cd480SApple OSS Distributions.Xr tip 1 ).
73*699cd480SApple OSS Distributions.Pp
74*699cd480SApple OSS DistributionsWhen an interactive user logs in, the system prepares the line to
75*699cd480SApple OSS Distributionsbehave in a certain way (called a
76*699cd480SApple OSS Distributions.Em "line discipline" ) ,
77*699cd480SApple OSS Distributionsthe particular details of which is described in
78*699cd480SApple OSS Distributions.Xr stty 1
79*699cd480SApple OSS Distributionsat the command level, and in
80*699cd480SApple OSS Distributions.Xr termios 4
81*699cd480SApple OSS Distributionsat the programming level.  A user may be concerned with changing
82*699cd480SApple OSS Distributionssettings associated with his particular login terminal and should refer
83*699cd480SApple OSS Distributionsto the preceding man pages for the common cases.  The remainder of
84*699cd480SApple OSS Distributionsthis man page is concerned
85*699cd480SApple OSS Distributionswith describing details of using and controlling terminal devices
86*699cd480SApple OSS Distributionsat a low level, such as that possibly required by a program wishing
87*699cd480SApple OSS Distributionsto provide features similar to those provided by the system.
88*699cd480SApple OSS Distributions.Ss Line disciplines
89*699cd480SApple OSS DistributionsA terminal file is used like any other file in the system in that
90*699cd480SApple OSS Distributionsit can be opened, read, and written to using standard system
91*699cd480SApple OSS Distributionscalls.  For each existing terminal file, there is a software processing module
92*699cd480SApple OSS Distributionscalled a
93*699cd480SApple OSS Distributions.Em "line discipline"
94*699cd480SApple OSS Distributionsis associated with it.  The
95*699cd480SApple OSS Distributions.Em "line discipline"
96*699cd480SApple OSS Distributionsessentially glues the low level device driver code with the high
97*699cd480SApple OSS Distributionslevel generic interface routines (such as
98*699cd480SApple OSS Distributions.Xr read 2
99*699cd480SApple OSS Distributionsand
100*699cd480SApple OSS Distributions.Xr write 2 ),
101*699cd480SApple OSS Distributionsand is responsible for implementing the semantics associated
102*699cd480SApple OSS Distributionswith the device.  When a terminal file is first opened by a program,
103*699cd480SApple OSS Distributionsthe default
104*699cd480SApple OSS Distributions.Em "line discipline"
105*699cd480SApple OSS Distributionscalled the
106*699cd480SApple OSS Distributions.Dv termios
107*699cd480SApple OSS Distributionsline discipline is associated with the file.  This is the primary
108*699cd480SApple OSS Distributionsline discipline that is used in most cases and provides the semantics
109*699cd480SApple OSS Distributionsthat users normally associate with a terminal.  When the
110*699cd480SApple OSS Distributions.Dv termios
111*699cd480SApple OSS Distributionsline discipline is in effect, the terminal file behaves and is
112*699cd480SApple OSS Distributionsoperated according to the rules described in
113*699cd480SApple OSS Distributions.Xr termios 4 .
114*699cd480SApple OSS DistributionsPlease refer to that man page for a full description of the terminal
115*699cd480SApple OSS Distributionssemantics.
116*699cd480SApple OSS DistributionsThe operations described here
117*699cd480SApple OSS Distributionsgenerally represent features common
118*699cd480SApple OSS Distributionsacross all
119*699cd480SApple OSS Distributions.Em "line disciplines" ,
120*699cd480SApple OSS Distributionshowever some of these calls may not
121*699cd480SApple OSS Distributionsmake sense in conjunction with a line discipline other than
122*699cd480SApple OSS Distributions.Dv termios ,
123*699cd480SApple OSS Distributionsand some may not be supported by the underlying
124*699cd480SApple OSS Distributionshardware (or lack thereof, as in the case of ptys).
125*699cd480SApple OSS Distributions.Ss Terminal File Operations
126*699cd480SApple OSS DistributionsAll of the following operations are invoked using the
127*699cd480SApple OSS Distributions.Xr ioctl 2
128*699cd480SApple OSS Distributionssystem call.  Refer to that man page for a description of
129*699cd480SApple OSS Distributionsthe
130*699cd480SApple OSS Distributions.Em request
131*699cd480SApple OSS Distributionsand
132*699cd480SApple OSS Distributions.Em argp
133*699cd480SApple OSS Distributionsparameters.
134*699cd480SApple OSS DistributionsIn addition to the ioctl
135*699cd480SApple OSS Distributions.Em requests
136*699cd480SApple OSS Distributionsdefined here, the specific line discipline
137*699cd480SApple OSS Distributionsin effect will define other
138*699cd480SApple OSS Distributions.Em requests
139*699cd480SApple OSS Distributionsspecific to it (actually
140*699cd480SApple OSS Distributions.Xr termios 4
141*699cd480SApple OSS Distributionsdefines them as function calls, not ioctl
142*699cd480SApple OSS Distributions.Em requests . )
143*699cd480SApple OSS DistributionsThe following section lists the available ioctl requests.  The
144*699cd480SApple OSS Distributionsname of the request, a description of its purpose, and the typed
145*699cd480SApple OSS Distributions.Em argp
146*699cd480SApple OSS Distributionsparameter (if any)
147*699cd480SApple OSS Distributionsare listed.  For example, the first entry says
148*699cd480SApple OSS Distributions.Pp
149*699cd480SApple OSS Distributions.D1 Em "TIOCSETD int *ldisc"
150*699cd480SApple OSS Distributions.Pp
151*699cd480SApple OSS Distributionsand would be called on the terminal associated with
152*699cd480SApple OSS Distributionsfile descriptor zero by the following code fragment:
153*699cd480SApple OSS Distributions.Bd -literal
154*699cd480SApple OSS Distributions	int ldisc;
155*699cd480SApple OSS Distributions
156*699cd480SApple OSS Distributions	ldisc = TTYDISC;
157*699cd480SApple OSS Distributions	ioctl(0, TIOCSETD, &ldisc);
158*699cd480SApple OSS Distributions.Ed
159*699cd480SApple OSS Distributions.Ss Terminal File Request Descriptions
160*699cd480SApple OSS Distributions.Bl -tag -width TIOCGWINSZ
161*699cd480SApple OSS Distributions.It Dv TIOCSETD Fa int *ldisc
162*699cd480SApple OSS DistributionsChange to the new line discipline pointed to by
163*699cd480SApple OSS Distributions.Fa ldisc .
164*699cd480SApple OSS DistributionsThe available line disciplines are listed in
165*699cd480SApple OSS Distributions.Pa Aq sys/ttycom.h
166*699cd480SApple OSS Distributionsand currently are:
167*699cd480SApple OSS Distributions.Pp
168*699cd480SApple OSS Distributions.Bl -tag -width TIOCGWINSZ -compact
169*699cd480SApple OSS Distributions.It TTYDISC
170*699cd480SApple OSS DistributionsTermios interactive line discipline.
171*699cd480SApple OSS Distributions.It TABLDISC
172*699cd480SApple OSS DistributionsTablet line discipline.
173*699cd480SApple OSS Distributions.It SLIPDISC
174*699cd480SApple OSS DistributionsSerial IP line discipline.
175*699cd480SApple OSS Distributions.It PPPDISC
176*699cd480SApple OSS DistributionsPPP line discipline.
177*699cd480SApple OSS Distributions.El
178*699cd480SApple OSS Distributions.Pp
179*699cd480SApple OSS Distributions.It Dv TIOCGETD Fa int *ldisc
180*699cd480SApple OSS DistributionsReturn the current line discipline in the integer pointed to by
181*699cd480SApple OSS Distributions.Fa ldisc .
182*699cd480SApple OSS Distributions.It Dv TIOCSBRK Fa void
183*699cd480SApple OSS DistributionsSet the terminal hardware into BREAK condition.
184*699cd480SApple OSS Distributions.It Dv TIOCCBRK Fa void
185*699cd480SApple OSS DistributionsClear the terminal hardware BREAK condition.
186*699cd480SApple OSS Distributions.It Dv TIOCSDTR Fa void
187*699cd480SApple OSS DistributionsAssert data terminal ready (DTR).
188*699cd480SApple OSS Distributions.It Dv TIOCCDTR Fa void
189*699cd480SApple OSS DistributionsClear data terminal ready (DTR).
190*699cd480SApple OSS Distributions.It Dv TIOCGPGRP Fa int *tpgrp
191*699cd480SApple OSS DistributionsReturn the current process group the terminal is associated
192*699cd480SApple OSS Distributionswith in the integer pointed to by
193*699cd480SApple OSS Distributions.Fa tpgrp .
194*699cd480SApple OSS DistributionsThis is the underlying call that implements the
195*699cd480SApple OSS Distributions.Xr termios 4
196*699cd480SApple OSS Distributions.Fn tcgetattr
197*699cd480SApple OSS Distributionscall.
198*699cd480SApple OSS Distributions.It Dv TIOCSPGRP Fa int *tpgrp
199*699cd480SApple OSS DistributionsAssociate the terminal with the process group (as an integer) pointed to by
200*699cd480SApple OSS Distributions.Fa tpgrp .
201*699cd480SApple OSS DistributionsThis is the underlying call that implements the
202*699cd480SApple OSS Distributions.Xr termios 4
203*699cd480SApple OSS Distributions.Fn tcsetattr
204*699cd480SApple OSS Distributionscall.
205*699cd480SApple OSS Distributions.It Dv TIOCGETA Fa struct termios *term
206*699cd480SApple OSS DistributionsPlace the current value of the termios state associated with the
207*699cd480SApple OSS Distributionsdevice in the termios structure pointed to by
208*699cd480SApple OSS Distributions.Fa term .
209*699cd480SApple OSS DistributionsThis is the underlying call that implements the
210*699cd480SApple OSS Distributions.Xr termios 4
211*699cd480SApple OSS Distributions.Fn tcgetattr
212*699cd480SApple OSS Distributionscall.
213*699cd480SApple OSS Distributions.It Dv TIOCSETA Fa struct termios *term
214*699cd480SApple OSS DistributionsSet the termios state associated with the device immediately.
215*699cd480SApple OSS DistributionsThis is the underlying call that implements the
216*699cd480SApple OSS Distributions.Xr termios 4
217*699cd480SApple OSS Distributions.Fn tcsetattr
218*699cd480SApple OSS Distributionscall with the
219*699cd480SApple OSS Distributions.Dv TCSANOW
220*699cd480SApple OSS Distributionsoption.
221*699cd480SApple OSS Distributions.It Dv TIOCSETAW Fa struct termios *term
222*699cd480SApple OSS DistributionsFirst wait for any output to complete, then set the termios state
223*699cd480SApple OSS Distributionsassociated with the device.
224*699cd480SApple OSS DistributionsThis is the underlying call that implements the
225*699cd480SApple OSS Distributions.Xr termios 4
226*699cd480SApple OSS Distributions.Fn tcsetattr
227*699cd480SApple OSS Distributionscall with the
228*699cd480SApple OSS Distributions.Dv TCSADRAIN
229*699cd480SApple OSS Distributionsoption.
230*699cd480SApple OSS Distributions.It Dv TIOCSETAF Fa struct termios *term
231*699cd480SApple OSS DistributionsFirst wait for any output to complete, clear any pending input,
232*699cd480SApple OSS Distributionsthen set the termios state associated with the device.
233*699cd480SApple OSS DistributionsThis is the underlying call that implements the
234*699cd480SApple OSS Distributions.Xr termios 4
235*699cd480SApple OSS Distributions.Fn tcsetattr
236*699cd480SApple OSS Distributionscall with the
237*699cd480SApple OSS Distributions.Dv TCSAFLUSH
238*699cd480SApple OSS Distributionsoption.
239*699cd480SApple OSS Distributions.It Dv TIOCOUTQ Fa int *num
240*699cd480SApple OSS DistributionsPlace the current number of characters in the output queue in the
241*699cd480SApple OSS Distributionsinteger pointed to by
242*699cd480SApple OSS Distributions.Fa num .
243*699cd480SApple OSS Distributions.It Dv TIOCSTI Fa char *cp
244*699cd480SApple OSS DistributionsSimulate typed input.  Pretend as if the terminal received the
245*699cd480SApple OSS Distributionscharacter pointed to by
246*699cd480SApple OSS Distributions.Fa cp .
247*699cd480SApple OSS Distributions.It Dv TIOCNOTTY Fa void
248*699cd480SApple OSS DistributionsThis call is obsolete but left for compatibility.  In the past, when
249*699cd480SApple OSS Distributionsa process that didn't have a controlling terminal (see
250*699cd480SApple OSS Distributions.Em The Controlling Terminal
251*699cd480SApple OSS Distributionsin
252*699cd480SApple OSS Distributions.Xr termios 4 )
253*699cd480SApple OSS Distributionsfirst opened a terminal device, it acquired that terminal as its
254*699cd480SApple OSS Distributionscontrolling terminal.  For some programs this was a hazard as they
255*699cd480SApple OSS Distributionsdidn't want a controlling terminal in the first place, and this
256*699cd480SApple OSS Distributionsprovided a mechanism to disassociate the controlling terminal from
257*699cd480SApple OSS Distributionsthe calling process.  It
258*699cd480SApple OSS Distributions.Em must
259*699cd480SApple OSS Distributionsbe called by opening the file
260*699cd480SApple OSS Distributions.Pa /dev/tty
261*699cd480SApple OSS Distributionsand calling
262*699cd480SApple OSS Distributions.Dv TIOCNOTTY
263*699cd480SApple OSS Distributionson that file descriptor.
264*699cd480SApple OSS Distributions.Pp
265*699cd480SApple OSS DistributionsThe current system does not allocate a controlling terminal to
266*699cd480SApple OSS Distributionsa process on an
267*699cd480SApple OSS Distributions.Fn open
268*699cd480SApple OSS Distributionscall: there is a specific ioctl called
269*699cd480SApple OSS Distributions.Dv TIOSCTTY
270*699cd480SApple OSS Distributionsto make a terminal the controlling
271*699cd480SApple OSS Distributionsterminal.
272*699cd480SApple OSS DistributionsIn addition, a program can
273*699cd480SApple OSS Distributions.Fn fork
274*699cd480SApple OSS Distributionsand call the
275*699cd480SApple OSS Distributions.Fn setsid
276*699cd480SApple OSS Distributionssystem call which will place the process into its own session - which
277*699cd480SApple OSS Distributionshas the effect of disassociating it from the controlling terminal.  This
278*699cd480SApple OSS Distributionsis the new and preferred method for programs to lose their controlling
279*699cd480SApple OSS Distributionsterminal.
280*699cd480SApple OSS Distributions.It Dv TIOCSTOP Fa void
281*699cd480SApple OSS DistributionsStop output on the terminal (like typing ^S at the keyboard).
282*699cd480SApple OSS Distributions.It Dv TIOCSTART Fa void
283*699cd480SApple OSS DistributionsStart output on the terminal (like typing ^Q at the keyboard).
284*699cd480SApple OSS Distributions.It Dv TIOCSCTTY Fa void
285*699cd480SApple OSS DistributionsMake the terminal the controlling terminal for the process (the process
286*699cd480SApple OSS Distributionsmust not currently have a controlling terminal).
287*699cd480SApple OSS Distributions.It Dv TIOCDRAIN Fa void
288*699cd480SApple OSS DistributionsWait until all output is drained.
289*699cd480SApple OSS Distributions.It Dv TIOCEXCL Fa void
290*699cd480SApple OSS DistributionsSet exclusive use on the terminal.  No further opens are permitted
291*699cd480SApple OSS Distributionsexcept by root.  Of course, this means that programs that are run by
292*699cd480SApple OSS Distributionsroot (or setuid) will not obey the exclusive setting - which limits
293*699cd480SApple OSS Distributionsthe usefulness of this feature.
294*699cd480SApple OSS Distributions.It Dv TIOCNXCL Fa void
295*699cd480SApple OSS DistributionsClear exclusive use of the terminal.  Further opens are permitted.
296*699cd480SApple OSS Distributions.It Dv TIOCFLUSH Fa int *what
297*699cd480SApple OSS DistributionsIf the value of the int pointed to by
298*699cd480SApple OSS Distributions.Fa what
299*699cd480SApple OSS Distributionscontains the
300*699cd480SApple OSS Distributions.Dv FREAD
301*699cd480SApple OSS Distributionsbit as defined in
302*699cd480SApple OSS Distributions.Pa Aq sys/file.h ,
303*699cd480SApple OSS Distributionsthen all characters in the input queue are cleared.  If it contains
304*699cd480SApple OSS Distributionsthe
305*699cd480SApple OSS Distributions.Dv FWRITE
306*699cd480SApple OSS Distributionsbit, then all characters in the output queue are cleared.  If the
307*699cd480SApple OSS Distributionsvalue of the integer is zero, then it behaves as if both the
308*699cd480SApple OSS Distributions.Dv FREAD
309*699cd480SApple OSS Distributionsand
310*699cd480SApple OSS Distributions.Dv FWRITE
311*699cd480SApple OSS Distributionsbits were set (i.e. clears both queues).
312*699cd480SApple OSS Distributions.It Dv TIOCGWINSZ Fa struct winsize *ws
313*699cd480SApple OSS DistributionsPut the window size information associated with the terminal in the
314*699cd480SApple OSS Distributions.Va winsize
315*699cd480SApple OSS Distributionsstructure pointed to by
316*699cd480SApple OSS Distributions.Fa ws .
317*699cd480SApple OSS DistributionsThe window size structure contains the number of rows and columns (and pixels
318*699cd480SApple OSS Distributionsif appropriate) of the devices attached to the terminal.  It is set by user software
319*699cd480SApple OSS Distributionsand is the means by which most full\&-screen oriented programs determine the
320*699cd480SApple OSS Distributionsscreen size.  The
321*699cd480SApple OSS Distributions.Va winsize
322*699cd480SApple OSS Distributionsstructure is defined in
323*699cd480SApple OSS Distributions.Pa Aq sys/ioctl.h .
324*699cd480SApple OSS Distributions.It Dv TIOCSWINSZ Fa struct winsize *ws
325*699cd480SApple OSS DistributionsSet the window size associated with the terminal to be the value in
326*699cd480SApple OSS Distributionsthe
327*699cd480SApple OSS Distributions.Va winsize
328*699cd480SApple OSS Distributionsstructure pointed to by
329*699cd480SApple OSS Distributions.Fa ws
330*699cd480SApple OSS Distributions(see above).
331*699cd480SApple OSS Distributions.It Dv TIOCCONS Fa int *on
332*699cd480SApple OSS DistributionsIf
333*699cd480SApple OSS Distributions.Fa on
334*699cd480SApple OSS Distributionspoints to a non-zero integer, redirect kernel console output (kernel printf's)
335*699cd480SApple OSS Distributionsto this terminal.
336*699cd480SApple OSS DistributionsIf
337*699cd480SApple OSS Distributions.Fa on
338*699cd480SApple OSS Distributionspoints to a zero integer, redirect kernel console output back to the normal
339*699cd480SApple OSS Distributionsconsole.  This is usually used on workstations to redirect kernel messages
340*699cd480SApple OSS Distributionsto a particular window.
341*699cd480SApple OSS Distributions.It Dv TIOCMSET Fa int *state
342*699cd480SApple OSS DistributionsThe integer pointed to by
343*699cd480SApple OSS Distributions.Fa state
344*699cd480SApple OSS Distributionscontains bits that correspond to modem state.  Following is a list
345*699cd480SApple OSS Distributionsof defined variables and the modem state they represent:
346*699cd480SApple OSS Distributions.Pp
347*699cd480SApple OSS Distributions.Bl -tag -width TIOCMXCTS -compact
348*699cd480SApple OSS Distributions.It TIOCM_LE
349*699cd480SApple OSS DistributionsLine Enable.
350*699cd480SApple OSS Distributions.It TIOCM_DTR
351*699cd480SApple OSS DistributionsData Terminal Ready.
352*699cd480SApple OSS Distributions.It TIOCM_RTS
353*699cd480SApple OSS DistributionsRequest To Send.
354*699cd480SApple OSS Distributions.It TIOCM_ST
355*699cd480SApple OSS DistributionsSecondary Transmit.
356*699cd480SApple OSS Distributions.It TIOCM_SR
357*699cd480SApple OSS DistributionsSecondary Receive.
358*699cd480SApple OSS Distributions.It TIOCM_CTS
359*699cd480SApple OSS DistributionsClear To Send.
360*699cd480SApple OSS Distributions.It TIOCM_CAR
361*699cd480SApple OSS DistributionsCarrier Detect.
362*699cd480SApple OSS Distributions.It TIOCM_CD
363*699cd480SApple OSS DistributionsCarrier Detect (synonym).
364*699cd480SApple OSS Distributions.It TIOCM_RNG
365*699cd480SApple OSS DistributionsRing Indication.
366*699cd480SApple OSS Distributions.It TIOCM_RI
367*699cd480SApple OSS DistributionsRing Indication (synonym).
368*699cd480SApple OSS Distributions.It TIOCM_DSR
369*699cd480SApple OSS DistributionsData Set Ready.
370*699cd480SApple OSS Distributions.El
371*699cd480SApple OSS Distributions.Pp
372*699cd480SApple OSS DistributionsThis call sets the terminal modem state to that represented by
373*699cd480SApple OSS Distributions.Fa state .
374*699cd480SApple OSS DistributionsNot all terminals may support this.
375*699cd480SApple OSS Distributions.It Dv TIOCMGET Fa int *state
376*699cd480SApple OSS DistributionsReturn the current state of the terminal modem lines as represented
377*699cd480SApple OSS Distributionsabove in the integer pointed to by
378*699cd480SApple OSS Distributions.Fa state .
379*699cd480SApple OSS Distributions.It Dv TIOCMBIS Fa int *state
380*699cd480SApple OSS DistributionsThe bits in the integer pointed to by
381*699cd480SApple OSS Distributions.Fa state
382*699cd480SApple OSS Distributionsrepresent modem state as described above, however the state is OR-ed
383*699cd480SApple OSS Distributionsin with the current state.
384*699cd480SApple OSS Distributions.It Dv TIOCMBIC Fa int *state
385*699cd480SApple OSS DistributionsThe bits in the integer pointed to by
386*699cd480SApple OSS Distributions.Fa state
387*699cd480SApple OSS Distributionsrepresent modem state as described above, however each bit which is on
388*699cd480SApple OSS Distributionsin
389*699cd480SApple OSS Distributions.Fa state
390*699cd480SApple OSS Distributionsis cleared in the terminal.
391*699cd480SApple OSS Distributions.El
392*699cd480SApple OSS Distributions.Sh SEE ALSO
393*699cd480SApple OSS Distributions.Xr stty 1 ,
394*699cd480SApple OSS Distributions.Xr ioctl 2 ,
395*699cd480SApple OSS Distributions.Xr pty 4 ,
396*699cd480SApple OSS Distributions.Xr termios 4 ,
397*699cd480SApple OSS Distributions.Xr getty 8
398