summaryrefslogtreecommitdiff
path: root/data/lsof/port.diff
blob: bddf3126219f7a958cc0579ce6e21720e99f3dd9 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
diff -ru lsof-33/lsof/Configure lsof-33+iPhone/lsof/Configure
--- lsof-33/lsof/Configure	2007-05-26 01:18:17.000000000 +0000
+++ lsof-33+iPhone/lsof/Configure	2008-04-18 09:22:40.000000000 +0000
@@ -892,12 +892,7 @@
 
     if test "X$DARWIN_BASE" = "X"	# {
     then
-      if test -r ${LSOF_INCLUDE}/../local/include/libproc.h -a $LSOF_VERS -ge 800 	# {
-      then
 	DARWIN_BASE="libproc"
-      else
-	DARWIN_BASE="/dev/kmem"
-      fi	# }
     fi	# }
     if test "X$DARWIN_BASE" = "Xlibproc"	# {
     then
@@ -934,62 +929,6 @@
 
     # Make sure Darwin XNU kernel headers are present.
 
-    LSOF_TMP5=""
-    for i in $LSOF_TMP1	# {
-    do
-      LSOF_TMP6=0
-      for j in $LSOF_TMP2 $LSOF_TMP3 $LSOF_TMP4 $LSOF_INCLUDE	# {
-      do
-	if test "X${j}" != "X" -a -r ${j}/${i}  # {
-	then
-	  LSOF_TMP6=1
-	  break
-	fi	# }
-      done	# }
-      if test $LSOF_TMP6 -ne 1	# {
-      then
-	if test "X$LSOF_TMP5" = "X"	# {
-	then
-	  LSOF_TMP5=$i
-	else
-	  LSOF_TMP5="$LSOF_TMP5 $i"
-	fi	# }
-      fi			# }
-    done	# }
-    if test "X$LSOF_TMP5" != "X"	# {
-    then
-
-    # If any Darwin XNU kernel header files are missing, call the
-    # get-hdr-loc.sh script to find the path.
-
-      LSOF_TMP6=`pwd`/dialects/darwin/get-hdr-loc.sh
-      if test ! -x $LSOF_TMP6	# {
-      then
-	echo "FATAL: can't execute: $LSOF_TMP6"
-	rm -f $LSOF_HLP
-	exit 1
-      fi	# }
-      DARWIN_XNUDIR=`$LSOF_TMP6 $LSOF_TMP5`
-      if test $? -ne 0	# {
-      then
-	echo "FATAL: $LSOF_TMP6 returns: $DARWIN_XNUDIR"
-	rm -f $LSOF_HLP
-	exit 1
-      fi	# }
-      LSOF_TMP2="${DARWIN_XNUDIR}/bsd"
-      LSOF_TMP3="${DARWIN_XNUDIR}/osfmk"
-      LSOF_TMP4=""
-    fi	# }
-
-    # Add header file paths.
-
-    for i in $LSOF_TMP2 $LSOF_TMP3 $LSOF_TMP4 $LSOF_INCLUDE	# {
-    do
-      if test -d $i -a "X$i" != "X/usr/include"	# {
-      then
-	LSOF_DINC="$LSOF_DINC -I${i}"
-      fi	# }
-    done	# }
     if test "X$DARWIN_BASE" = "X/dev/kmem"	# {
     then
 
diff -ru lsof-33/lsof/dialects/darwin/kmem/dfile.c lsof-33+iPhone/lsof/dialects/darwin/kmem/dfile.c
--- lsof-33/lsof/dialects/darwin/kmem/dfile.c	2007-05-24 22:35:11.000000000 +0000
+++ lsof-33+iPhone/lsof/dialects/darwin/kmem/dfile.c	2008-04-18 08:46:17.000000000 +0000
@@ -44,6 +44,7 @@
  */
 
 #if	DARWINV>=800
+#include <sys/file_internal.h>
 #define	file		fileglob
 #define	f_flag		fg_flag
 #define	f_type		fg_type
diff -ru lsof-33/lsof/dialects/darwin/kmem/dlsof.h lsof-33+iPhone/lsof/dialects/darwin/kmem/dlsof.h
--- lsof-33/lsof/dialects/darwin/kmem/dlsof.h	2007-05-24 22:35:11.000000000 +0000
+++ lsof-33+iPhone/lsof/dialects/darwin/kmem/dlsof.h	2008-04-18 09:04:15.000000000 +0000
@@ -38,6 +38,11 @@
 #if	!defined(DARWIN_LSOF_H)
 #define	DARWIN_LSOF_H	1
 
+#define KERNEL
+#define	KERNEL_PRIVATE
+#include <sys/select.h>
+#undef KERNEL_PRIVATE
+#undef KERNEL
 #include <stdlib.h>
 #include <dirent.h>
 #include <nlist.h>
@@ -52,7 +57,13 @@
 #include <sys/mount.h>
 #define	m_stat	mnt_stat
 #else	/* DARWINV>=800 */
+#include <machine/locks.h>
+#define KERNEL
+#include <sys/mount.h>
+#undef KERNEL
+#define PRIVATE
 #include <sys/mount_internal.h>
+#undef PRIVATE
 #define	m_stat	mnt_vfsstat
 #endif	/* DARWINV>=800 */
 
@@ -60,7 +71,9 @@
 #include <sys/uio.h>
 #include <sys/vnode.h>
 #else	/* DARWINV>=800 */
+#define KERNEL
 #include <sys/vnode.h>
+#undef KERNEL
 #define	_SYS_SYSTM_H_
 struct nameidata { int dummy; };	/* to satisfy function  prototypes */
 #include <sys/vnode_internal.h>
@@ -70,20 +83,32 @@
 #define	KERNEL_PRIVATE
 #include <sys/socketvar.h>
 #undef	KERNEL_PRIVATE
+#define PRIVATE
 #include <sys/protosw.h>
+#undef PRIVATE
 #include <sys/socket.h>
 #include <sys/un.h>
+#define KERNEL
+#define PRIVATE
 #include <sys/unpcb.h>
+#undef PRIVATE
+#undef KERNEL
 
 # if	defined(AF_NDRV)
+#define PRIVATE
 #include <net/if_var.h>
+#undef PRIVATE
 #define	KERNEL
+#define PRIVATE
 #include <sys/kern_event.h>
+#undef PRIVATE
 #undef	KERNEL
 #include <net/ndrv.h>
 #  if	DARWINV>=530
 #define	KERNEL        1
+#define PRIVATE
 #include <net/ndrv_var.h>
+#undef PRIVATE
 #undef  KERNEL
 #  endif	/* DARWINV>=530 */
 # endif	/* defined(AF_NDRV) */
@@ -91,16 +116,24 @@
 # if	defined(AF_SYSTEM)
 #include <sys/queue.h>
 #define	KERNEL
+#define PRIVATE
 #include <sys/kern_event.h>
+#undef PRIVATE
 #undef	KERNEL
 # endif	/* defined(AF_SYSTEM) */
 
+#define PRIVATE
 #include <netinet/in.h>
+#undef PRIVATE
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
+#define PRIVATE
 #include <net/route.h>
+#undef PRIVATE
 #include <netinet6/ipsec.h>
+#define KERNEL_PRIVATE
 #include <netinet/in_pcb.h>
+#undef KERNEL_PRIVATE
 #include <netinet/ip_var.h>
 #include <netinet/tcp.h>
 #include <netinet/tcpip.h>
@@ -109,7 +142,9 @@
 #include <netinet/tcp_var.h>
 #include <arpa/inet.h>
 #include <net/raw_cb.h>
+#define PRIVATE
 #include <sys/domain.h>
+#undef PRIVATE
 #define	pmap	RPC_pmap
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
@@ -168,7 +203,7 @@
 # if	DARWINV<800
 #include <sys/sysctl.h>
 # else	/* DARWINV>=800 */
-#include "/usr/include/sys/sysctl.h"
+#include "sys/sysctl.h"
 # endif	/* DARWINV<800 */
 
 # if	DARWINV<800
@@ -177,8 +212,10 @@
 #include <sys/file.h>
 #undef	KERNEL
 # else	/* DARWINV>=800 */
+#define KERNEL
 #include <sys/fcntl.h>
 #include <sys/file_internal.h>
+#undef KERNEL
 # endif	/* DARWINV<800 */
 
 # if	defined(HASKQUEUE)
diff -ru lsof-33/lsof/dialects/darwin/kmem/machine.h lsof-33+iPhone/lsof/dialects/darwin/kmem/machine.h
--- lsof-33/lsof/dialects/darwin/kmem/machine.h	2007-05-24 22:35:11.000000000 +0000
+++ lsof-33+iPhone/lsof/dialects/darwin/kmem/machine.h	2008-04-18 07:27:27.000000000 +0000
@@ -43,7 +43,7 @@
 #include <sys/param.h>
 
 # if	DARWINV>=800
-#include "/usr/include/string.h"
+#include "string.h"
 # endif	/* DARWINV>=800 */
 
 
diff -ru lsof-33/lsof/dialects/darwin/libproc/machine.h lsof-33+iPhone/lsof/dialects/darwin/libproc/machine.h
--- lsof-33/lsof/dialects/darwin/libproc/machine.h	2006-03-23 21:28:26.000000000 +0000
+++ lsof-33+iPhone/lsof/dialects/darwin/libproc/machine.h	2008-04-18 09:23:12.000000000 +0000
@@ -46,7 +46,7 @@
 #include <sys/types.h>
 #include <sys/param.h>
 
-#include "/usr/include/string.h"
+#include "string.h"
 
 
 /*
diff -ru lsof-33/lsof/lsof.h lsof-33+iPhone/lsof/lsof.h
--- lsof-33/lsof/lsof.h	2007-05-24 22:35:11.000000000 +0000
+++ lsof-33+iPhone/lsof/lsof.h	2008-04-18 09:05:04.000000000 +0000
@@ -46,6 +46,11 @@
 
 #include "lsof_fields.h"
 
+#define KERNEL
+#include <mach/port.h>
+#undef KERNEL
+#define _MACH_PORT_T
+
 #include <ctype.h>
 #include <errno.h>
 
@@ -53,7 +58,9 @@
 #include <locale.h>
 # endif	/* defined(HASSETLOCALE) */
 
+#define PRIVATE
 #include <netdb.h>
+#undef PRIVATE
 #include <pwd.h>
 #include <stdio.h>