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