1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
$NetBSD: patch-ad,v 1.1 2006/03/05 08:17:49 christos Exp $
--- ioctl.c 2005-02-02 15:32:13.000000000 -0500
+++ ioctl.c 2006-03-05 02:02:48.000000000 -0500
@@ -32,6 +32,7 @@
#include "defs.h"
+#ifndef NETBSD
const struct ioctlent ioctlent0[] = {
/*
* `ioctlent.h' may be generated from `ioctlent.raw' by the auxiliary
@@ -42,6 +43,9 @@
*/
#include "ioctlent.h"
};
+#else
+#include "ioctlent.h"
+#endif
#ifdef LINUX
#include <asm/ioctl.h>
@@ -68,6 +72,7 @@
const struct ioctlent *ioctlent;
int nioctlents;
+#ifndef NETBSD
static int
compare(a, b)
const void *a;
@@ -77,11 +82,19 @@
unsigned long code2 = ((struct ioctlent *) b)->code;
return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0;
}
+#endif
const struct ioctlent *
ioctl_lookup(code)
long code;
{
+#ifdef NETBSD
+ int i;
+ for (i = 0; i < nioctlents; i++)
+ if (ioctlent[i].code == code)
+ return &ioctlent[i];
+ return NULL;
+#else
struct ioctlent *iop, ioent;
ioent.code = code;
@@ -96,6 +109,7 @@
break;
}
return iop;
+#endif
}
const struct ioctlent *
@@ -130,14 +144,14 @@
case 0x89:
#else /* !LINUX */
case 'r': case 's': case 'i':
-#ifndef FREEBSD
+#ifndef ALLBSD
case 'p':
#endif
#endif /* !LINUX */
return sock_ioctl(tcp, code, arg);
#ifdef USE_PROCFS
#ifndef HAVE_MP_PROCFS
-#ifndef FREEBSD
+#ifndef ALLBSD
case 'q':
#else
case 'p':
|