blob: c397db9bd3138ab826e0e94dddac39dbab8e8745 (
plain)
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
|
$NetBSD: patch-ai,v 1.2 2007/04/27 19:45:01 christos Exp $
--- ioctl.c.orig 2005-02-02 15:32:13.000000000 -0500
+++ ioctl.c 2007-04-27 11:35:05.000000000 -0400
@@ -68,6 +68,7 @@
const struct ioctlent *ioctlent;
int nioctlents;
+#ifndef NETBSD
static int
compare(a, b)
const void *a;
@@ -77,11 +78,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 +105,7 @@
break;
}
return iop;
+#endif
}
const struct ioctlent *
@@ -130,14 +140,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':
|