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