1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 23*0Sstevel@tonic-gate /* All Rights Reserved */ 24*0Sstevel@tonic-gate 25*0Sstevel@tonic-gate /* 26*0Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 27*0Sstevel@tonic-gate * The Regents of the University of California 28*0Sstevel@tonic-gate * All Rights Reserved 29*0Sstevel@tonic-gate * 30*0Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 31*0Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 32*0Sstevel@tonic-gate * contributors. 33*0Sstevel@tonic-gate */ 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate #ifndef _SYS_TTOLD_H 36*0Sstevel@tonic-gate #define _SYS_TTOLD_H 37*0Sstevel@tonic-gate 38*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate #ifdef __cplusplus 41*0Sstevel@tonic-gate extern "C" { 42*0Sstevel@tonic-gate #endif 43*0Sstevel@tonic-gate 44*0Sstevel@tonic-gate /* All the ioctls (BSD, V7, XENIX, S5) defines are in termios.h */ 45*0Sstevel@tonic-gate /* this file has mostly BSD structures and flags */ 46*0Sstevel@tonic-gate 47*0Sstevel@tonic-gate /* BSD special characters. Structure for TIOCSTC/TIOCGTC */ 48*0Sstevel@tonic-gate struct tchars { 49*0Sstevel@tonic-gate char t_intrc; /* interrupt */ 50*0Sstevel@tonic-gate char t_quitc; /* quit */ 51*0Sstevel@tonic-gate char t_startc; /* start output */ 52*0Sstevel@tonic-gate char t_stopc; /* stop output */ 53*0Sstevel@tonic-gate char t_eofc; /* end-of-file */ 54*0Sstevel@tonic-gate char t_brkc; /* input delimiter (like nl) */ 55*0Sstevel@tonic-gate }; 56*0Sstevel@tonic-gate 57*0Sstevel@tonic-gate /* note xenix defines tchars as tc */ 58*0Sstevel@tonic-gate struct tc { 59*0Sstevel@tonic-gate char t_intrc; /* interrupt */ 60*0Sstevel@tonic-gate char t_quitc; /* quit */ 61*0Sstevel@tonic-gate char t_startc; /* start output */ 62*0Sstevel@tonic-gate char t_stopc; /* stop output */ 63*0Sstevel@tonic-gate char t_eofc; /* end-of-file */ 64*0Sstevel@tonic-gate char t_brkc; /* input delimiter (like nl) */ 65*0Sstevel@tonic-gate }; 66*0Sstevel@tonic-gate 67*0Sstevel@tonic-gate #ifndef _SGTTY_H 68*0Sstevel@tonic-gate /* 69*0Sstevel@tonic-gate * Structure for TIOCGETP and TIOCSETP ioctls. 70*0Sstevel@tonic-gate */ 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate /* sg_flags value changed from short (in SUN/BSD) to int in System V to */ 73*0Sstevel@tonic-gate /* match sgtty.h definition */ 74*0Sstevel@tonic-gate struct sgttyb { 75*0Sstevel@tonic-gate char sg_ispeed; /* input speed */ 76*0Sstevel@tonic-gate char sg_ospeed; /* output speed */ 77*0Sstevel@tonic-gate char sg_erase; /* erase character */ 78*0Sstevel@tonic-gate char sg_kill; /* kill character */ 79*0Sstevel@tonic-gate int sg_flags; /* mode flags */ 80*0Sstevel@tonic-gate }; 81*0Sstevel@tonic-gate 82*0Sstevel@tonic-gate /* BSD local special chars. Structure for TIOCSLTC/TIOCGLTC */ 83*0Sstevel@tonic-gate struct ltchars { 84*0Sstevel@tonic-gate char t_suspc; /* stop process signal */ 85*0Sstevel@tonic-gate char t_dsuspc; /* delayed stop process signal */ 86*0Sstevel@tonic-gate char t_rprntc; /* reprint line */ 87*0Sstevel@tonic-gate char t_flushc; /* flush output (toggles) */ 88*0Sstevel@tonic-gate char t_werasc; /* word erase */ 89*0Sstevel@tonic-gate char t_lnextc; /* literal next character */ 90*0Sstevel@tonic-gate }; 91*0Sstevel@tonic-gate #endif /* _SGTTY_H */ 92*0Sstevel@tonic-gate 93*0Sstevel@tonic-gate /* 94*0Sstevel@tonic-gate * 4.3BSD/XENIX tty ioctl commands that are either: 95*0Sstevel@tonic-gate * 1) deprecated 96*0Sstevel@tonic-gate * 2) not implemented (and never were implemented) 97*0Sstevel@tonic-gate * 3) implemented on top of new-style "ioctl"s. 98*0Sstevel@tonic-gate */ 99*0Sstevel@tonic-gate 100*0Sstevel@tonic-gate /* 101*0Sstevel@tonic-gate * These ioctls are also defined in termios.h. 102*0Sstevel@tonic-gate * because XENIX expects to see them in termio.h 103*0Sstevel@tonic-gate */ 104*0Sstevel@tonic-gate 105*0Sstevel@tonic-gate #ifndef tIOC 106*0Sstevel@tonic-gate #define tIOC ('t'<<8) 107*0Sstevel@tonic-gate #endif 108*0Sstevel@tonic-gate 109*0Sstevel@tonic-gate #ifndef _SYS_TERMIOS_H 110*0Sstevel@tonic-gate /* defined in termios.h also so that all the ioctl codes are visible */ 111*0Sstevel@tonic-gate 112*0Sstevel@tonic-gate #define TIOCGETD (tIOC|0) 113*0Sstevel@tonic-gate #define TIOCSETD (tIOC|1) 114*0Sstevel@tonic-gate #ifndef _SGTTY_H 115*0Sstevel@tonic-gate #define TIOCHPCL (tIOC|2) 116*0Sstevel@tonic-gate #define TIOCGETP (tIOC|8) 117*0Sstevel@tonic-gate #define TIOCSETP (tIOC|9) 118*0Sstevel@tonic-gate #endif /* _SGTTY_H */ 119*0Sstevel@tonic-gate #define TIOCSETN (tIOC|10) 120*0Sstevel@tonic-gate #ifndef _SGTTY_H 121*0Sstevel@tonic-gate #define TIOCEXCL (tIOC|13) 122*0Sstevel@tonic-gate #define TIOCNXCL (tIOC|14) 123*0Sstevel@tonic-gate #endif /* _SGTTY_H */ 124*0Sstevel@tonic-gate #define TIOCFLUSH (tIOC|16) 125*0Sstevel@tonic-gate #define TIOCSETC (tIOC|17) 126*0Sstevel@tonic-gate #define TIOCGETC (tIOC|18) 127*0Sstevel@tonic-gate 128*0Sstevel@tonic-gate /* BSD ioctls that are not the same as XENIX */ 129*0Sstevel@tonic-gate #define TIOCLBIS (tIOC|127) /* bis local mode bits */ 130*0Sstevel@tonic-gate #define TIOCLBIC (tIOC|126) /* bic local mode bits */ 131*0Sstevel@tonic-gate #define TIOCLSET (tIOC|125) /* set entire local mode word */ 132*0Sstevel@tonic-gate #define TIOCLGET (tIOC|124) /* get local modes */ 133*0Sstevel@tonic-gate #define TIOCSBRK (tIOC|123) /* set break bit */ 134*0Sstevel@tonic-gate #define TIOCCBRK (tIOC|122) /* clear break bit */ 135*0Sstevel@tonic-gate #define TIOCSDTR (tIOC|121) /* set data terminal ready */ 136*0Sstevel@tonic-gate #define TIOCCDTR (tIOC|120) /* clear data terminal ready */ 137*0Sstevel@tonic-gate #define TIOCSLTC (tIOC|117) /* set local special chars */ 138*0Sstevel@tonic-gate #define TIOCGLTC (tIOC|116) /* get local special chars */ 139*0Sstevel@tonic-gate #define TIOCOUTQ (tIOC|115) /* driver output queue size */ 140*0Sstevel@tonic-gate #define TIOCNOTTY (tIOC|113) /* void tty association */ 141*0Sstevel@tonic-gate #define TIOCSTOP (tIOC|111) /* stop output, like ^S */ 142*0Sstevel@tonic-gate #define TIOCSTART (tIOC|110) /* start output, like ^Q */ 143*0Sstevel@tonic-gate 144*0Sstevel@tonic-gate #define TIOCREMOTE (tIOC|30) /* remote input editing */ 145*0Sstevel@tonic-gate 146*0Sstevel@tonic-gate /* windowing ioctls and structure also defined in termios.h */ 147*0Sstevel@tonic-gate 148*0Sstevel@tonic-gate #ifndef _TIOC 149*0Sstevel@tonic-gate #define _TIOC ('T'<<8) 150*0Sstevel@tonic-gate #endif 151*0Sstevel@tonic-gate 152*0Sstevel@tonic-gate #define TIOCGWINSZ (_TIOC|104) 153*0Sstevel@tonic-gate #define TIOCSWINSZ (_TIOC|103) 154*0Sstevel@tonic-gate 155*0Sstevel@tonic-gate /* Windowing structure to support TIOCSWINSZ/TIOCGWINSZ */ 156*0Sstevel@tonic-gate struct winsize { 157*0Sstevel@tonic-gate unsigned short ws_row; /* rows, in characters */ 158*0Sstevel@tonic-gate unsigned short ws_col; /* columns, in character */ 159*0Sstevel@tonic-gate unsigned short ws_xpixel; /* horizontal size, pixels */ 160*0Sstevel@tonic-gate unsigned short ws_ypixel; /* vertical size, pixels */ 161*0Sstevel@tonic-gate }; 162*0Sstevel@tonic-gate 163*0Sstevel@tonic-gate 164*0Sstevel@tonic-gate #endif /* end _SYS_TERMIOS_H */ 165*0Sstevel@tonic-gate 166*0Sstevel@tonic-gate /* Old SVR3.0 flags - should be removed if there is no problem */ 167*0Sstevel@tonic-gate /* note they are commented out */ 168*0Sstevel@tonic-gate 169*0Sstevel@tonic-gate #if 0 170*0Sstevel@tonic-gate 171*0Sstevel@tonic-gate #define O_HUPCL 01 172*0Sstevel@tonic-gate #define O_XTABS 02 173*0Sstevel@tonic-gate #define O_LCASE 04 /* simulate lower case */ 174*0Sstevel@tonic-gate #define O_ECHO 010 /* echo input */ 175*0Sstevel@tonic-gate #define O_CRMOD 020 /* map \r to \r\n on output */ 176*0Sstevel@tonic-gate #define O_RAW 040 /* no i/o processing */ 177*0Sstevel@tonic-gate #define O_ODDP 0100 /* get/send odd parity */ 178*0Sstevel@tonic-gate #define O_EVENP 0200 /* get/send even parity */ 179*0Sstevel@tonic-gate #define O_NLDELAY 001400 /* \n delay */ 180*0Sstevel@tonic-gate #define O_NL1 000400 181*0Sstevel@tonic-gate #define O_NL2 001000 182*0Sstevel@tonic-gate #define O_TBDELAY 002000 /* horizontal tab delay */ 183*0Sstevel@tonic-gate #define O_NOAL 004000 184*0Sstevel@tonic-gate #define O_CRDELAY 030000 /* \r delay */ 185*0Sstevel@tonic-gate #define O_CR1 010000 186*0Sstevel@tonic-gate #define O_CR2 020000 187*0Sstevel@tonic-gate #define O_VTDELAY 040000 /* vertical tab delay */ 188*0Sstevel@tonic-gate #define O_BSDELAY 0100000 /* \b delay */ 189*0Sstevel@tonic-gate 190*0Sstevel@tonic-gate #endif 191*0Sstevel@tonic-gate 192*0Sstevel@tonic-gate /* 193*0Sstevel@tonic-gate * 4.3 BSD additions. These are new codes and some of the 194*0Sstevel@tonic-gate * flags that were there in SVR3.2 ttold.h have been given 195*0Sstevel@tonic-gate * new codes. Otherwise they will not fit in a word. 196*0Sstevel@tonic-gate */ 197*0Sstevel@tonic-gate 198*0Sstevel@tonic-gate #define O_TANDEM 0x00000001 /* send stopc on out q full */ 199*0Sstevel@tonic-gate #define O_CBREAK 0x00000002 /* half-cooked mode */ 200*0Sstevel@tonic-gate #define O_LCASE 0x00000004 /* simulate lower case */ 201*0Sstevel@tonic-gate #define O_ECHO 0x00000008 /* echo input */ 202*0Sstevel@tonic-gate #define O_CRMOD 0x00000010 /* map \r to \r\n on output */ 203*0Sstevel@tonic-gate #define O_RAW 0x00000020 /* no i/o processing */ 204*0Sstevel@tonic-gate #define O_ODDP 0x00000040 /* get/send odd parity */ 205*0Sstevel@tonic-gate #define O_EVENP 0x00000080 /* get/send even parity */ 206*0Sstevel@tonic-gate #define O_ANYP 0x000000c0 /* get any parity/send none */ 207*0Sstevel@tonic-gate #define O_NLDELAY 0x00000300 /* \n delay */ 208*0Sstevel@tonic-gate #define O_NL0 0x00000000 209*0Sstevel@tonic-gate #define O_NL1 0x00000100 /* tty 37 */ 210*0Sstevel@tonic-gate #define O_NL2 0x00000200 /* vt05 */ 211*0Sstevel@tonic-gate #define O_NL3 0x00000300 212*0Sstevel@tonic-gate #define O_TBDELAY 0x00000c00 /* horizontal tab delay */ 213*0Sstevel@tonic-gate #define O_TAB0 0x00000000 214*0Sstevel@tonic-gate #define O_TAB1 0x00000400 /* tty 37 */ 215*0Sstevel@tonic-gate #define O_TAB2 0x00000800 216*0Sstevel@tonic-gate #define O_XTABS 0x00000c00 /* expand tabs on output */ 217*0Sstevel@tonic-gate #define O_CRDELAY 0x00003000 /* \r delay */ 218*0Sstevel@tonic-gate #define O_CR0 0x00000000 219*0Sstevel@tonic-gate #define O_CR1 0x00001000 /* tn 300 */ 220*0Sstevel@tonic-gate #define O_CR2 0x00002000 /* tty 37 */ 221*0Sstevel@tonic-gate #define O_CR3 0x00003000 /* concept 100 */ 222*0Sstevel@tonic-gate #define O_VTDELAY 0x00004000 /* vertical tab delay */ 223*0Sstevel@tonic-gate #define O_FF0 0x00000000 224*0Sstevel@tonic-gate #define O_FF1 0x00004000 /* tty 37 */ 225*0Sstevel@tonic-gate #define O_BSDELAY 0x00008000 /* \b delay */ 226*0Sstevel@tonic-gate #define O_BS0 0x00000000 227*0Sstevel@tonic-gate #define O_BS1 0x00008000 228*0Sstevel@tonic-gate #define O_ALLDELAY \ 229*0Sstevel@tonic-gate (O_NLDELAY|O_TBDELAY|O_CRDELAY|O_VTDELAY|O_BSDELAY) 230*0Sstevel@tonic-gate #define O_CRTBS 0x00010000 /* do backspacing for crt */ 231*0Sstevel@tonic-gate #define O_PRTERA 0x00020000 /* \ ... / erase */ 232*0Sstevel@tonic-gate #define O_CRTERA 0x00040000 /* " \b " to wipe out char */ 233*0Sstevel@tonic-gate #define O_TILDE 0x00080000 /* hazeltine tilde kludge */ 234*0Sstevel@tonic-gate #define O_MDMBUF 0x00100000 /* start/stop output on */ 235*0Sstevel@tonic-gate /* carrier intr */ 236*0Sstevel@tonic-gate #define O_LITOUT 0x00200000 /* literal output */ 237*0Sstevel@tonic-gate #define O_TOSTOP 0x00400000 /* SIGSTOP on background */ 238*0Sstevel@tonic-gate /* output */ 239*0Sstevel@tonic-gate #define O_FLUSHO 0x00800000 /* flush output to terminal */ 240*0Sstevel@tonic-gate #define O_NOHANG 0x01000000 /* no SIGHUP on carrier drop */ 241*0Sstevel@tonic-gate #define O_L001000 0x02000000 242*0Sstevel@tonic-gate #define O_CRTKIL 0x04000000 /* kill line with " \b " */ 243*0Sstevel@tonic-gate #define O_PASS8 0x08000000 244*0Sstevel@tonic-gate #define O_CTLECH 0x10000000 /* echo control chars as ^X */ 245*0Sstevel@tonic-gate #define O_PENDIN 0x20000000 /* tp->t_rawq needs reread */ 246*0Sstevel@tonic-gate #define O_DECCTQ 0x40000000 /* only ^Q starts after ^S */ 247*0Sstevel@tonic-gate #define O_NOFLSH 0x80000000 /* no output flush on signal */ 248*0Sstevel@tonic-gate 249*0Sstevel@tonic-gate /* more BSD flags */ 250*0Sstevel@tonic-gate #define LCRTBS (O_CRTBS>>16) 251*0Sstevel@tonic-gate #define LPRTERA (O_PRTERA>>16) 252*0Sstevel@tonic-gate #define LCRTERA (O_CRTERA>>16) 253*0Sstevel@tonic-gate #define LTILDE (O_TILDE>>16) 254*0Sstevel@tonic-gate #define LMDMBUF (O_MDMBUF>>16) 255*0Sstevel@tonic-gate #define LLITOUT (O_LITOUT>>16) 256*0Sstevel@tonic-gate #define LTOSTOP (O_TOSTOP>>16) 257*0Sstevel@tonic-gate #define LFLUSHO (O_FLUSHO>>16) 258*0Sstevel@tonic-gate #define LNOHANG (O_NOHANG>>16) 259*0Sstevel@tonic-gate #define LCRTKIL (O_CRTKIL>>16) 260*0Sstevel@tonic-gate #define LPASS8 (O_PASS8>>16) 261*0Sstevel@tonic-gate #define LCTLECH (O_CTLECH>>16) 262*0Sstevel@tonic-gate #define LPENDIN (O_PENDIN>>16) 263*0Sstevel@tonic-gate #define LDECCTQ (O_DECCTQ>>16) 264*0Sstevel@tonic-gate #define LNOFLSH (O_NOFLSH>>16) 265*0Sstevel@tonic-gate 266*0Sstevel@tonic-gate 267*0Sstevel@tonic-gate #define NOPOST 0x00000001 /* no processing on output (LITOUT */ 268*0Sstevel@tonic-gate /* with 7 bits + parity) */ 269*0Sstevel@tonic-gate #define NOISIG 0x00000002 /* disable all signal-generating */ 270*0Sstevel@tonic-gate /* characters */ 271*0Sstevel@tonic-gate #define STOPB 0x00000004 /* two stop bits */ 272*0Sstevel@tonic-gate 273*0Sstevel@tonic-gate #define OTTYDISC 0 /* old, v7 std tty driver */ 274*0Sstevel@tonic-gate #define NETLDISC 1 /* line discip for berk net */ 275*0Sstevel@tonic-gate #define NTTYDISC 2 /* new tty discipline */ 276*0Sstevel@tonic-gate #define TABLDISC 3 /* hitachi tablet discipline */ 277*0Sstevel@tonic-gate #define NTABLDISC 4 /* gtco tablet discipline */ 278*0Sstevel@tonic-gate #define MOUSELDISC 5 /* mouse discipline */ 279*0Sstevel@tonic-gate #define KBDLDISC 6 /* up/down keyboard trans (console) */ 280*0Sstevel@tonic-gate 281*0Sstevel@tonic-gate #ifdef __cplusplus 282*0Sstevel@tonic-gate } 283*0Sstevel@tonic-gate #endif 284*0Sstevel@tonic-gate 285*0Sstevel@tonic-gate #endif /* _SYS_TTOLD_H */ 286