root / lab4 / .minix-src / include / sys / ioctl.h @ 14
History | View | Annotate | Download (4.56 KB)
1 |
/* $NetBSD: ioctl.h,v 1.36 2009/02/13 22:41:04 apb Exp $ */
|
---|---|
2 |
|
3 |
/*-
|
4 |
* Copyright (c) 1982, 1986, 1990, 1993, 1994
|
5 |
* The Regents of the University of California. All rights reserved.
|
6 |
* (c) UNIX System Laboratories, Inc.
|
7 |
* All or some portions of this file are derived from material licensed
|
8 |
* to the University of California by American Telephone and Telegraph
|
9 |
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
10 |
* the permission of UNIX System Laboratories, Inc.
|
11 |
*
|
12 |
* Redistribution and use in source and binary forms, with or without
|
13 |
* modification, are permitted provided that the following conditions
|
14 |
* are met:
|
15 |
* 1. Redistributions of source code must retain the above copyright
|
16 |
* notice, this list of conditions and the following disclaimer.
|
17 |
* 2. Redistributions in binary form must reproduce the above copyright
|
18 |
* notice, this list of conditions and the following disclaimer in the
|
19 |
* documentation and/or other materials provided with the distribution.
|
20 |
* 3. Neither the name of the University nor the names of its contributors
|
21 |
* may be used to endorse or promote products derived from this software
|
22 |
* without specific prior written permission.
|
23 |
*
|
24 |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
25 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
26 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
27 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
28 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
29 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
30 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
31 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
32 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
33 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
34 |
* SUCH DAMAGE.
|
35 |
*
|
36 |
* @(#)ioctl.h 8.6 (Berkeley) 3/28/94
|
37 |
*/
|
38 |
|
39 |
#ifndef _SYS_IOCTL_H_
|
40 |
#define _SYS_IOCTL_H_
|
41 |
|
42 |
#include <sys/ttycom.h> |
43 |
|
44 |
/*
|
45 |
* Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
|
46 |
* and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
|
47 |
* nonwithstanding).
|
48 |
*/
|
49 |
struct ttysize {
|
50 |
unsigned short ts_lines; |
51 |
unsigned short ts_cols; |
52 |
unsigned short ts_xxx; |
53 |
unsigned short ts_yyy; |
54 |
}; |
55 |
#define TIOCGSIZE TIOCGWINSZ
|
56 |
#define TIOCSSIZE TIOCSWINSZ
|
57 |
|
58 |
#include <sys/ioccom.h> |
59 |
|
60 |
#include <sys/dkio.h> |
61 |
#include <sys/filio.h> |
62 |
#include <sys/sockio.h> |
63 |
|
64 |
#if defined(__minix)
|
65 |
/* ioctls */
|
66 |
#include <sys/ioc_net.h> /* 'n' */ |
67 |
#include <sys/ioc_disk.h> /* 'd' */ |
68 |
#include <sys/ioc_file.h> /* 'f' */ |
69 |
#include <sys/ioc_memory.h> /* 'm' */ |
70 |
#include <sys/ioc_tape.h> /* 'M' */ |
71 |
#include <sys/ioc_sound.h> /* 's' */ |
72 |
#include <sys/ioc_block.h> /* 'b' */ |
73 |
#include <sys/ioc_fbd.h> /* 'B' */ |
74 |
#include <sys/ioc_fb.h> /* 'V' */ |
75 |
#include <dev/vndvar.h> /* 'F' */ |
76 |
#include <dev/i2c/i2c_io.h> |
77 |
#endif /* defined(__minix) */ |
78 |
|
79 |
/*
|
80 |
* Passthrough ioctl commands. These are passed through to devices
|
81 |
* as they are, it is expected that the device (a module, for example),
|
82 |
* will know how to deal with them. One for each emulation, so that
|
83 |
* no namespace clashes will occur between them, for devices that
|
84 |
* may be dealing with specific ioctls for multiple emulations.
|
85 |
*/
|
86 |
|
87 |
struct ioctl_pt {
|
88 |
unsigned long com; |
89 |
void *data;
|
90 |
}; |
91 |
|
92 |
#define PTIOCNETBSD _IOW('Z', 0, struct ioctl_pt) |
93 |
#define PTIOCSUNOS _IOW('Z', 1, struct ioctl_pt) |
94 |
#define PTIOCSVR4 _IOW('Z', 2, struct ioctl_pt) |
95 |
#define PTIOCLINUX _IOW('Z', 3, struct ioctl_pt) |
96 |
#define PTIOCFREEBSD _IOW('Z', 4, struct ioctl_pt) |
97 |
#define PTIOCOSF1 _IOW('Z', 5, struct ioctl_pt) |
98 |
#define PTIOCULTRIX _IOW('Z', 6, struct ioctl_pt) |
99 |
#define PTIOCWIN32 _IOW('Z', 7, struct ioctl_pt) |
100 |
|
101 |
#ifndef _KERNEL
|
102 |
|
103 |
#include <sys/cdefs.h> |
104 |
|
105 |
__BEGIN_DECLS |
106 |
int ioctl(int, unsigned long, ...); |
107 |
__END_DECLS |
108 |
#endif /* !_KERNEL */ |
109 |
#endif /* !_SYS_IOCTL_H_ */ |
110 |
|
111 |
#if !defined(__minix)
|
112 |
/*
|
113 |
* Keep outside _SYS_IOCTL_H_
|
114 |
* Compatibility with old terminal driver
|
115 |
*
|
116 |
* Source level -> #define USE_OLD_TTY
|
117 |
* Kernel level -> options COMPAT_43 or COMPAT_SUNOS or ...
|
118 |
*/
|
119 |
|
120 |
#if defined(_KERNEL_OPT)
|
121 |
#include "opt_compat_freebsd.h" |
122 |
#include "opt_compat_sunos.h" |
123 |
#include "opt_compat_svr4.h" |
124 |
#include "opt_compat_43.h" |
125 |
#include "opt_compat_osf1.h" |
126 |
#include "opt_compat_ibcs2.h" |
127 |
#include "opt_modular.h" |
128 |
#endif
|
129 |
|
130 |
#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS) || \
|
131 |
defined(COMPAT_SVR4) || defined(COMPAT_FREEBSD) || defined(COMPAT_OSF1) || \ |
132 |
defined(COMPAT_IBCS2) || defined(MODULAR) |
133 |
#include <sys/ioctl_compat.h> |
134 |
#endif /* !defined(__minix) */ |
135 |
#endif
|