xref: /xnu-11215.81.4/bsd/sys/ioctl_compat.h (revision d4514f0bc1d3f944c22d92e68b646ac3fb40d452)
1*d4514f0bSApple OSS Distributions /*
2*d4514f0bSApple OSS Distributions  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3*d4514f0bSApple OSS Distributions  *
4*d4514f0bSApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*d4514f0bSApple OSS Distributions  *
6*d4514f0bSApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*d4514f0bSApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*d4514f0bSApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*d4514f0bSApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10*d4514f0bSApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11*d4514f0bSApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12*d4514f0bSApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13*d4514f0bSApple OSS Distributions  * terms of an Apple operating system software license agreement.
14*d4514f0bSApple OSS Distributions  *
15*d4514f0bSApple OSS Distributions  * Please obtain a copy of the License at
16*d4514f0bSApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*d4514f0bSApple OSS Distributions  *
18*d4514f0bSApple OSS Distributions  * The Original Code and all software distributed under the License are
19*d4514f0bSApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*d4514f0bSApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*d4514f0bSApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*d4514f0bSApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*d4514f0bSApple OSS Distributions  * Please see the License for the specific language governing rights and
24*d4514f0bSApple OSS Distributions  * limitations under the License.
25*d4514f0bSApple OSS Distributions  *
26*d4514f0bSApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*d4514f0bSApple OSS Distributions  */
28*d4514f0bSApple OSS Distributions /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
29*d4514f0bSApple OSS Distributions /*
30*d4514f0bSApple OSS Distributions  * Copyright (c) 1990, 1993
31*d4514f0bSApple OSS Distributions  *	The Regents of the University of California.  All rights reserved.
32*d4514f0bSApple OSS Distributions  * (c) UNIX System Laboratories, Inc.
33*d4514f0bSApple OSS Distributions  * All or some portions of this file are derived from material licensed
34*d4514f0bSApple OSS Distributions  * to the University of California by American Telephone and Telegraph
35*d4514f0bSApple OSS Distributions  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
36*d4514f0bSApple OSS Distributions  * the permission of UNIX System Laboratories, Inc.
37*d4514f0bSApple OSS Distributions  *
38*d4514f0bSApple OSS Distributions  * Redistribution and use in source and binary forms, with or without
39*d4514f0bSApple OSS Distributions  * modification, are permitted provided that the following conditions
40*d4514f0bSApple OSS Distributions  * are met:
41*d4514f0bSApple OSS Distributions  * 1. Redistributions of source code must retain the above copyright
42*d4514f0bSApple OSS Distributions  *    notice, this list of conditions and the following disclaimer.
43*d4514f0bSApple OSS Distributions  * 2. Redistributions in binary form must reproduce the above copyright
44*d4514f0bSApple OSS Distributions  *    notice, this list of conditions and the following disclaimer in the
45*d4514f0bSApple OSS Distributions  *    documentation and/or other materials provided with the distribution.
46*d4514f0bSApple OSS Distributions  * 3. All advertising materials mentioning features or use of this software
47*d4514f0bSApple OSS Distributions  *    must display the following acknowledgement:
48*d4514f0bSApple OSS Distributions  *	This product includes software developed by the University of
49*d4514f0bSApple OSS Distributions  *	California, Berkeley and its contributors.
50*d4514f0bSApple OSS Distributions  * 4. Neither the name of the University nor the names of its contributors
51*d4514f0bSApple OSS Distributions  *    may be used to endorse or promote products derived from this software
52*d4514f0bSApple OSS Distributions  *    without specific prior written permission.
53*d4514f0bSApple OSS Distributions  *
54*d4514f0bSApple OSS Distributions  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55*d4514f0bSApple OSS Distributions  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56*d4514f0bSApple OSS Distributions  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57*d4514f0bSApple OSS Distributions  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58*d4514f0bSApple OSS Distributions  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59*d4514f0bSApple OSS Distributions  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60*d4514f0bSApple OSS Distributions  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61*d4514f0bSApple OSS Distributions  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62*d4514f0bSApple OSS Distributions  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63*d4514f0bSApple OSS Distributions  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64*d4514f0bSApple OSS Distributions  * SUCH DAMAGE.
65*d4514f0bSApple OSS Distributions  *
66*d4514f0bSApple OSS Distributions  *	@(#)ioctl_compat.h	8.4 (Berkeley) 1/21/94
67*d4514f0bSApple OSS Distributions  */
68*d4514f0bSApple OSS Distributions 
69*d4514f0bSApple OSS Distributions #ifndef _SYS_IOCTL_COMPAT_H_
70*d4514f0bSApple OSS Distributions #define _SYS_IOCTL_COMPAT_H_
71*d4514f0bSApple OSS Distributions 
72*d4514f0bSApple OSS Distributions #include <sys/ttychars.h>
73*d4514f0bSApple OSS Distributions #include <sys/ttydev.h>
74*d4514f0bSApple OSS Distributions 
75*d4514f0bSApple OSS Distributions struct tchars {
76*d4514f0bSApple OSS Distributions 	char    t_intrc;        /* interrupt */
77*d4514f0bSApple OSS Distributions 	char    t_quitc;        /* quit */
78*d4514f0bSApple OSS Distributions 	char    t_startc;       /* start output */
79*d4514f0bSApple OSS Distributions 	char    t_stopc;        /* stop output */
80*d4514f0bSApple OSS Distributions 	char    t_eofc;         /* end-of-file */
81*d4514f0bSApple OSS Distributions 	char    t_brkc;         /* input delimiter (like nl) */
82*d4514f0bSApple OSS Distributions };
83*d4514f0bSApple OSS Distributions 
84*d4514f0bSApple OSS Distributions struct ltchars {
85*d4514f0bSApple OSS Distributions 	char    t_suspc;        /* stop process signal */
86*d4514f0bSApple OSS Distributions 	char    t_dsuspc;       /* delayed stop process signal */
87*d4514f0bSApple OSS Distributions 	char    t_rprntc;       /* reprint line */
88*d4514f0bSApple OSS Distributions 	char    t_flushc;       /* flush output (toggles) */
89*d4514f0bSApple OSS Distributions 	char    t_werasc;       /* word erase */
90*d4514f0bSApple OSS Distributions 	char    t_lnextc;       /* literal next character */
91*d4514f0bSApple OSS Distributions };
92*d4514f0bSApple OSS Distributions 
93*d4514f0bSApple OSS Distributions /*
94*d4514f0bSApple OSS Distributions  * Structure for TIOCGETP and TIOCSETP ioctls.
95*d4514f0bSApple OSS Distributions  */
96*d4514f0bSApple OSS Distributions #ifndef _SGTTYB_
97*d4514f0bSApple OSS Distributions #define _SGTTYB_
98*d4514f0bSApple OSS Distributions struct sgttyb {
99*d4514f0bSApple OSS Distributions 	char    sg_ispeed;              /* input speed */
100*d4514f0bSApple OSS Distributions 	char    sg_ospeed;              /* output speed */
101*d4514f0bSApple OSS Distributions 	char    sg_erase;               /* erase character */
102*d4514f0bSApple OSS Distributions 	char    sg_kill;                /* kill character */
103*d4514f0bSApple OSS Distributions 	short   sg_flags;               /* mode flags */
104*d4514f0bSApple OSS Distributions };
105*d4514f0bSApple OSS Distributions #endif
106*d4514f0bSApple OSS Distributions 
107*d4514f0bSApple OSS Distributions #ifdef USE_OLD_TTY
108*d4514f0bSApple OSS Distributions # undef  TIOCGETD
109*d4514f0bSApple OSS Distributions # define TIOCGETD       _IOR('t', 0, int)       /* get line discipline */
110*d4514f0bSApple OSS Distributions # undef  TIOCSETD
111*d4514f0bSApple OSS Distributions # define TIOCSETD       _IOW('t', 1, int)       /* set line discipline */
112*d4514f0bSApple OSS Distributions #else
113*d4514f0bSApple OSS Distributions # define OTIOCGETD      _IOR('t', 0, int)       /* get line discipline */
114*d4514f0bSApple OSS Distributions # define OTIOCSETD      _IOW('t', 1, int)       /* set line discipline */
115*d4514f0bSApple OSS Distributions #endif
116*d4514f0bSApple OSS Distributions #define TIOCHPCL        _IO('t', 2)             /* hang up on last close */
117*d4514f0bSApple OSS Distributions #define TIOCGETP        _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
118*d4514f0bSApple OSS Distributions #define TIOCSETP        _IOW('t', 9,struct sgttyb)/* set parameters -- stty */
119*d4514f0bSApple OSS Distributions #define TIOCSETN        _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
120*d4514f0bSApple OSS Distributions #define TIOCSETC        _IOW('t',17,struct tchars)/* set special characters */
121*d4514f0bSApple OSS Distributions #define TIOCGETC        _IOR('t',18,struct tchars)/* get special characters */
122*d4514f0bSApple OSS Distributions #define         TANDEM          0x00000001      /* send stopc on out q full */
123*d4514f0bSApple OSS Distributions #define         CBREAK          0x00000002      /* half-cooked mode */
124*d4514f0bSApple OSS Distributions #define         LCASE           0x00000004      /* simulate lower case */
125*d4514f0bSApple OSS Distributions #define         ECHO            0x00000008      /* echo input */
126*d4514f0bSApple OSS Distributions #define         CRMOD           0x00000010      /* map \r to \r\n on output */
127*d4514f0bSApple OSS Distributions #define         RAW             0x00000020      /* no i/o processing */
128*d4514f0bSApple OSS Distributions #define         ODDP            0x00000040      /* get/send odd parity */
129*d4514f0bSApple OSS Distributions #define         EVENP           0x00000080      /* get/send even parity */
130*d4514f0bSApple OSS Distributions #define         ANYP            0x000000c0      /* get any parity/send none */
131*d4514f0bSApple OSS Distributions #define         NLDELAY         0x00000300      /* \n delay */
132*d4514f0bSApple OSS Distributions #define         TBDELAY         0x00000c00      /* horizontal tab delay */
133*d4514f0bSApple OSS Distributions #define         XTABS           0x00000c00      /* expand tabs on output */
134*d4514f0bSApple OSS Distributions #define         CRDELAY         0x00003000      /* \r delay */
135*d4514f0bSApple OSS Distributions #define         VTDELAY         0x00004000      /* vertical tab delay */
136*d4514f0bSApple OSS Distributions #define         BSDELAY         0x00008000      /* \b delay */
137*d4514f0bSApple OSS Distributions #ifndef _SYS_TERMIOS_H_
138*d4514f0bSApple OSS Distributions /*
139*d4514f0bSApple OSS Distributions  * These manifest constants have the same names as those in <sys/termios.h>,
140*d4514f0bSApple OSS Distributions  * so you are not permitted to have both definitions in scope simultaneously
141*d4514f0bSApple OSS Distributions  * in the same compilation unit.
142*d4514f0bSApple OSS Distributions  */
143*d4514f0bSApple OSS Distributions #define                 NL0     0x00000000
144*d4514f0bSApple OSS Distributions #define                 NL1     0x00000100      /* tty 37 */
145*d4514f0bSApple OSS Distributions #define                 NL2     0x00000200      /* vt05 */
146*d4514f0bSApple OSS Distributions #define                 NL3     0x00000300
147*d4514f0bSApple OSS Distributions #define                 TAB0    0x00000000
148*d4514f0bSApple OSS Distributions #define                 TAB1    0x00000400      /* tty 37 */
149*d4514f0bSApple OSS Distributions #define                 TAB2    0x00000800
150*d4514f0bSApple OSS Distributions #define                 CR0     0x00000000
151*d4514f0bSApple OSS Distributions #define                 CR1     0x00001000      /* tn 300 */
152*d4514f0bSApple OSS Distributions #define                 CR2     0x00002000      /* tty 37 */
153*d4514f0bSApple OSS Distributions #define                 CR3     0x00003000      /* concept 100 */
154*d4514f0bSApple OSS Distributions #define                 FF0     0x00000000
155*d4514f0bSApple OSS Distributions #define                 FF1     0x00004000      /* tty 37 */
156*d4514f0bSApple OSS Distributions #define                 BS0     0x00000000
157*d4514f0bSApple OSS Distributions #define                 BS1     0x00008000
158*d4514f0bSApple OSS Distributions #endif  /* !_SYS_TERMIOS_H_ */
159*d4514f0bSApple OSS Distributions #define         ALLDELAY        (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
160*d4514f0bSApple OSS Distributions #define         CRTBS           0x00010000      /* do backspacing for crt */
161*d4514f0bSApple OSS Distributions #define         PRTERA          0x00020000      /* \ ... / erase */
162*d4514f0bSApple OSS Distributions #define         CRTERA          0x00040000      /* " \b " to wipe out char */
163*d4514f0bSApple OSS Distributions #define         TILDE           0x00080000      /* hazeltine tilde kludge */
164*d4514f0bSApple OSS Distributions #define         MDMBUF          0x00100000      /*start/stop output on carrier*/
165*d4514f0bSApple OSS Distributions #define         LITOUT          0x00200000      /* literal output */
166*d4514f0bSApple OSS Distributions #define         TOSTOP          0x00400000      /*SIGSTOP on background output*/
167*d4514f0bSApple OSS Distributions #define         FLUSHO          0x00800000      /* flush output to terminal */
168*d4514f0bSApple OSS Distributions #define         NOHANG          0x01000000      /* (no-op) was no SIGHUP on carrier drop */
169*d4514f0bSApple OSS Distributions #define         L001000         0x02000000
170*d4514f0bSApple OSS Distributions #define         CRTKIL          0x04000000      /* kill line with " \b " */
171*d4514f0bSApple OSS Distributions #define         PASS8           0x08000000
172*d4514f0bSApple OSS Distributions #define         CTLECH          0x10000000      /* echo control chars as ^X */
173*d4514f0bSApple OSS Distributions #define         PENDIN          0x20000000      /* tp->t_rawq needs reread */
174*d4514f0bSApple OSS Distributions #define         DECCTQ          0x40000000      /* only ^Q starts after ^S */
175*d4514f0bSApple OSS Distributions #define         NOFLSH          0x80000000      /* no output flush on signal */
176*d4514f0bSApple OSS Distributions #define TIOCLBIS        _IOW('t', 127, int)     /* bis local mode bits */
177*d4514f0bSApple OSS Distributions #define TIOCLBIC        _IOW('t', 126, int)     /* bic local mode bits */
178*d4514f0bSApple OSS Distributions #define TIOCLSET        _IOW('t', 125, int)     /* set entire local mode word */
179*d4514f0bSApple OSS Distributions #define TIOCLGET        _IOR('t', 124, int)     /* get local modes */
180*d4514f0bSApple OSS Distributions #define         LCRTBS          (CRTBS>>16)
181*d4514f0bSApple OSS Distributions #define         LPRTERA         (PRTERA>>16)
182*d4514f0bSApple OSS Distributions #define         LCRTERA         (CRTERA>>16)
183*d4514f0bSApple OSS Distributions #define         LTILDE          (TILDE>>16)
184*d4514f0bSApple OSS Distributions #define         LMDMBUF         (MDMBUF>>16)
185*d4514f0bSApple OSS Distributions #define         LLITOUT         (LITOUT>>16)
186*d4514f0bSApple OSS Distributions #define         LTOSTOP         (TOSTOP>>16)
187*d4514f0bSApple OSS Distributions #define         LFLUSHO         (FLUSHO>>16)
188*d4514f0bSApple OSS Distributions #define         LNOHANG         (NOHANG>>16)
189*d4514f0bSApple OSS Distributions #define         LCRTKIL         (CRTKIL>>16)
190*d4514f0bSApple OSS Distributions #define         LPASS8          (PASS8>>16)
191*d4514f0bSApple OSS Distributions #define         LCTLECH         (CTLECH>>16)
192*d4514f0bSApple OSS Distributions #define         LPENDIN         (PENDIN>>16)
193*d4514f0bSApple OSS Distributions #define         LDECCTQ         (DECCTQ>>16)
194*d4514f0bSApple OSS Distributions #define         LNOFLSH         (NOFLSH>>16)
195*d4514f0bSApple OSS Distributions #define TIOCSLTC        _IOW('t',117,struct ltchars)/* set local special chars*/
196*d4514f0bSApple OSS Distributions #define TIOCGLTC        _IOR('t',116,struct ltchars)/* get local special chars*/
197*d4514f0bSApple OSS Distributions #define OTIOCCONS       _IO('t', 98)    /* for hp300 -- sans int arg */
198*d4514f0bSApple OSS Distributions #define OTTYDISC        0
199*d4514f0bSApple OSS Distributions #define NETLDISC        1
200*d4514f0bSApple OSS Distributions #define NTTYDISC        2
201*d4514f0bSApple OSS Distributions 
202*d4514f0bSApple OSS Distributions #define TIOCGSID        _IOR('t', 99, int)      /* For svr4 -- get session id */
203*d4514f0bSApple OSS Distributions 
204*d4514f0bSApple OSS Distributions #endif /* !_SYS_IOCTL_COMPAT_H_ */
205