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 #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 +#undef KERNEL_PRIVATE +#undef KERNEL #include #include #include @@ -52,7 +57,13 @@ #include #define m_stat mnt_stat #else /* DARWINV>=800 */ +#include +#define KERNEL +#include +#undef KERNEL +#define PRIVATE #include +#undef PRIVATE #define m_stat mnt_vfsstat #endif /* DARWINV>=800 */ @@ -60,7 +71,9 @@ #include #include #else /* DARWINV>=800 */ +#define KERNEL #include +#undef KERNEL #define _SYS_SYSTM_H_ struct nameidata { int dummy; }; /* to satisfy function prototypes */ #include @@ -70,20 +83,32 @@ #define KERNEL_PRIVATE #include #undef KERNEL_PRIVATE +#define PRIVATE #include +#undef PRIVATE #include #include +#define KERNEL +#define PRIVATE #include +#undef PRIVATE +#undef KERNEL # if defined(AF_NDRV) +#define PRIVATE #include +#undef PRIVATE #define KERNEL +#define PRIVATE #include +#undef PRIVATE #undef KERNEL #include # if DARWINV>=530 #define KERNEL 1 +#define PRIVATE #include +#undef PRIVATE #undef KERNEL # endif /* DARWINV>=530 */ # endif /* defined(AF_NDRV) */ @@ -91,16 +116,24 @@ # if defined(AF_SYSTEM) #include #define KERNEL +#define PRIVATE #include +#undef PRIVATE #undef KERNEL # endif /* defined(AF_SYSTEM) */ +#define PRIVATE #include +#undef PRIVATE #include #include +#define PRIVATE #include +#undef PRIVATE #include +#define KERNEL_PRIVATE #include +#undef KERNEL_PRIVATE #include #include #include @@ -109,7 +142,9 @@ #include #include #include +#define PRIVATE #include +#undef PRIVATE #define pmap RPC_pmap #include #include @@ -168,7 +203,7 @@ # if DARWINV<800 #include # else /* DARWINV>=800 */ -#include "/usr/include/sys/sysctl.h" +#include "sys/sysctl.h" # endif /* DARWINV<800 */ # if DARWINV<800 @@ -177,8 +212,10 @@ #include #undef KERNEL # else /* DARWINV>=800 */ +#define KERNEL #include #include +#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 # 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 #include -#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 +#undef KERNEL +#define _MACH_PORT_T + #include #include @@ -53,7 +58,9 @@ #include # endif /* defined(HASSETLOCALE) */ +#define PRIVATE #include +#undef PRIVATE #include #include