diff options
author | atatat <atatat@pkgsrc.org> | 2004-11-28 22:39:07 +0000 |
---|---|---|
committer | atatat <atatat@pkgsrc.org> | 2004-11-28 22:39:07 +0000 |
commit | 76d4751d5c036b6eea19155855c8ffdfe61b456d (patch) | |
tree | 4aa9589eaee39d6cd255e8fa74bf7671dc411f01 /sysutils/lsof | |
parent | c88ff0fa15b0e56000567f9b5936dd4b3a8583cc (diff) | |
download | pkgsrc-76d4751d5c036b6eea19155855c8ffdfe61b456d.tar.gz |
Tweak the sys/bufq.h support (it disappeared again), enhance the
procfs support a little, incorporate the author's patches to deal with
netbsd-current version numbers getting longer, and add ptyfs support.
These patches are adapted from an interim release the author made and
will appear in the next full release.
PKGREVISION bumped to 1 for the ptyfs support.
Diffstat (limited to 'sysutils/lsof')
-rw-r--r-- | sysutils/lsof/Makefile | 4 | ||||
-rw-r--r-- | sysutils/lsof/distinfo | 13 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-aa | 40 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ab | 124 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ac | 929 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ad | 25 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ae | 161 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-af | 21 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ag | 31 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ah | 45 |
10 files changed, 1365 insertions, 28 deletions
diff --git a/sysutils/lsof/Makefile b/sysutils/lsof/Makefile index 3926c572c66..1cf1cc251bd 100644 --- a/sysutils/lsof/Makefile +++ b/sysutils/lsof/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.78 2004/10/21 13:09:20 atatat Exp $ +# $NetBSD: Makefile,v 1.79 2004/11/28 22:39:07 atatat Exp $ # DISTNAME= lsof_4.73 +PKGREVISION= 1 PKGNAME= ${DISTNAME:S/_/-/} CATEGORIES= sysutils MASTER_SITES= ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ \ @@ -30,6 +31,7 @@ SRCBALL_NAME= ${DISTNAME}_src PKG_INSTALLATION_TYPES= overwrite pkgviews USE_BUILDLINK3= yes +BUILDLINK_PASSTHRU_DIRS= /usr/src/sys .include "../../mk/bsd.prefs.mk" diff --git a/sysutils/lsof/distinfo b/sysutils/lsof/distinfo index dc59f443ec8..726d082a3fd 100644 --- a/sysutils/lsof/distinfo +++ b/sysutils/lsof/distinfo @@ -1,7 +1,12 @@ -$NetBSD: distinfo,v 1.45 2004/11/12 05:41:36 erh Exp $ +$NetBSD: distinfo,v 1.46 2004/11/28 22:39:07 atatat Exp $ SHA1 (lsof_4.73.tar.bz2) = 3e8112f854fc83f5e5dfdc9271c8d27d31aefc6c Size (lsof_4.73.tar.bz2) = 725530 bytes -SHA1 (patch-aa) = 36790019394b4088c226222d4aefaec50430bcf3 -SHA1 (patch-ab) = 339dde4ed2d24fbfcfadb52f0cc5dfe2b1861170 -SHA1 (patch-ac) = f8ea499518695f5dbed2536c89373840fc3272c9 +SHA1 (patch-aa) = 4878381537330258e9270c9d198d49a426283fab +SHA1 (patch-ab) = f35db0c78d3b6a743d132900649d1bf31617ca63 +SHA1 (patch-ac) = e8388f7e6925c89b0a2264a35dd3e264f9d135e4 +SHA1 (patch-ad) = 49f3d0899e8055815c8b25d304281f83e7b1a98d +SHA1 (patch-ae) = fc314546f0b3769414939cf22894e69c13589f1e +SHA1 (patch-af) = 0a5ca7b243be925cba841b1358427e86b65ccde1 +SHA1 (patch-ag) = 06a5a07cf550136c8b58f82d4aa0f75d85378db0 +SHA1 (patch-ah) = 35dc2b9ec90a1f418d3cd103b951db46df19bf3c diff --git a/sysutils/lsof/patches/patch-aa b/sysutils/lsof/patches/patch-aa index 2b5ebec017d..b8d1eb2b209 100644 --- a/sysutils/lsof/patches/patch-aa +++ b/sysutils/lsof/patches/patch-aa @@ -1,13 +1,18 @@ -$NetBSD: patch-aa,v 1.23 2003/11/22 23:30:03 atatat Exp $ +$NetBSD: patch-aa,v 1.24 2004/11/28 22:39:07 atatat Exp $ If LSOF_MORE_SECURE is non-zero, compile lsof with security, and only let unprivileged (non-root) users view their own open files. Set LSOF_LESS_SECURE_SOCKETS to non-zero in order to allow non-root users to see open sockets, even when LSOF_MORE_SECURE is set. ---- dialects/n+obsd/machine.h.orig Tue Dec 3 13:23:54 2002 +Also, incorporate a patch from the author that widens the NETBSDV +definition to account for new current versioning system, properly +handles the sys/bufq.h mess, adds a bit more to procfs support, and +adds ptyfs support. + +--- dialects/n+obsd/machine.h.orig 2004-10-17 17:55:27.000000000 -0400 +++ dialects/n+obsd/machine.h -@@ -371,7 +371,9 @@ +@@ -383,7 +383,9 @@ * (the one that its user logged on with) of the lsof process. */ @@ -18,7 +23,7 @@ users to see open sockets, even when LSOF_MORE_SECURE is set. /* -@@ -380,7 +382,9 @@ +@@ -392,7 +394,9 @@ * listing is selected by the "-i" option. */ @@ -29,3 +34,30 @@ users to see open sockets, even when LSOF_MORE_SECURE is set. /* +@@ -407,9 +411,9 @@ + + #define HASSETLOCALE 1 + +-# if defined(NETBSDV) && NETBSDV>=1060 ++# if defined(NETBSDV) && NETBSDV>=1006000 + #define HASWIDECHAR 1 +-# endif /* defined(NETBSDV) && NETBSDV>=1060*/ ++# endif /* defined(NETBSDV) && NETBSDV>=1006000 */ + + /* #define WIDECHARINCL <wchar.h> */ + +@@ -529,11 +533,11 @@ + /* #define USE_LIB_READMNT 1 rmnt.c */ + /* #define USE_LIB_REGEX 1 regex.c */ + +-# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) ++# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) + #define USE_LIB_RNMH 1 /* rnmh.c */ +-# else /* (defined(OPENBSDV) && OPENBSDV<2010) && (defined(NETBSDV) && NETBSDV<1020) */ ++# else /* (defined(OPENBSDV) && OPENBSDV<2010) && (defined(NETBSDV) && NETBSDV<1002000) */ + #define USE_LIB_RNAM 1 /* rnam.c */ +-# endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */ ++# endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ + + /* #define USE_LIB_RNCH 1 rnch.c */ + /* #define USE_LIB_SNPF 1 snpf.c */ diff --git a/sysutils/lsof/patches/patch-ab b/sysutils/lsof/patches/patch-ab index 0ad19a2e20c..5bf6635f75a 100644 --- a/sysutils/lsof/patches/patch-ab +++ b/sysutils/lsof/patches/patch-ab @@ -1,16 +1,130 @@ -$NetBSD: patch-ab,v 1.30 2004/11/07 18:16:27 kim Exp $ +$NetBSD: patch-ab,v 1.31 2004/11/28 22:39:07 atatat Exp $ + +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. --- dialects/n+obsd/dlsof.h.orig 2004-03-10 18:51:36.000000000 -0500 -+++ dialects/n+obsd/dlsof.h 2004-11-07 13:12:14.000000000 -0500 -@@ -245,6 +245,11 @@ ++++ dialects/n+obsd/dlsof.h +@@ -98,9 +98,9 @@ struct uio; /* dummy for function protot + #include <rpc/types.h> + #include <sys/protosw.h> + +-# if defined(NETBSDV) && NETBSDV>=1030 ++# if defined(NETBSDV) && NETBSDV>=1003000 + #define sockproto NETBSD_sockproto +-# endif /* defined(NETBSDV) && NETBSDV>=1030 */ ++# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ + + #include <sys/socket.h> + +@@ -145,9 +145,9 @@ struct nameidata; /* to satisfy a functi + #include <msdosfs/denode.h> + # endif /* defined(HASMSDOSFS) */ + +-# if defined(NETBSDV) && NETBSDV>=1030 ++# if defined(NETBSDV) && NETBSDV>=1003000 + #undef sockproto +-# endif /* defined(NETBSDV) && NETBSDV>=1030 */ ++# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ + + #include <sys/socketvar.h> + #include <sys/un.h> +@@ -202,7 +202,7 @@ struct nameidata; /* to satisfy a functi + + #include <sys/vnode.h> + +-# if defined(NETBSDV) && NETBSDV>=1030 ++# if defined(NETBSDV) && NETBSDV>=1003000 + /* + * Because late in the 1.3I NetBSD development cycle the sockproto structure + * was placed under _KERNEL in <sys/socket.h>, and because defining _KERNEL +@@ -217,7 +217,7 @@ struct sockproto { + u_short sp_family; + u_short sp_protocol; + }; +-# endif /* defined(NETBSDV) && NETBSDV>=1030 */ ++# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ + + #include <net/raw_cb.h> + #include <sys/domain.h> +@@ -245,6 +245,14 @@ struct sockproto { #undef DIRENT_DIRBLKSIZ # endif /*defined(DIRENT_BLKSIZ) */ -+# if defined(NETBSDV) && NETBSDV>=2991 ++# if defined(HASBUFQ_H) ++# if defined(NETBSDV) && NETBSDV>=2099010 +#define _KERNEL +#include <sys/bufq.h> +#undef _KERNEL -+# endif /* defined(NETBSDV) && NETBSDV>=2991 */ ++# endif /* defined(NETBSDV) && NETBSDV>=2099010 */ ++#endif /* defined(HASBUFQ_H) */ ++ #undef KERNEL #include <ufs/mfs/mfsnode.h> +@@ -331,9 +339,9 @@ struct sockproto { + + # if defined(HASNULLFS) + #define _KERNEL +-# if defined(NETBSDV) && NETBSDV>=1050 && __NetBSD_Version__<106060000 ++# if defined(NETBSDV) && NETBSDV>=1005000 && __NetBSD_Version__<106060000 + #include "netexport.h" +-# endif /* defined(NETBSDV) && NETBSDV>=1050 ++# endif /* defined(NETBSDV) && NETBSDV>=1005000 + && __NetBSD_Version__<106060000 */ + #include <miscfs/nullfs/null.h> + #undef _KERNEL +@@ -357,10 +365,20 @@ struct sockproto { + #define Pstatus PFSstatus + #define Pnote PFSnote + #define Pnotepg PFSnotepg ++#define Pfd PFSfd ++#define Pmap PFSmap ++#define Pmaps PFSmaps + # endif /* defined(HASPROCFS_PFSROOT) */ + #include <machine/reg.h> + # endif /* defined(HASPROCFS) */ + ++# if defined(HASPTYFS) ++#define _KERNEL ++#include <fs/ptyfs/ptyfs.h> ++#include <miscfs/specfs/specdev.h> ++#undef _KERNEL ++# endif /* defined(HASPTYFS) */ ++ + #define KERNEL + #define _KERNEL + #include <sys/file.h> +@@ -515,9 +533,9 @@ struct sfile { + */ + + # if defined(HASNCACHE) +-# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) ++# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) + #include <stddef.h> +-#endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */ ++#endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ + + #include <sys/uio.h> + #include <sys/namei.h> +@@ -527,15 +545,15 @@ struct sfile { + #define NCACHE_NODEADDR nc_vp /* node address in NCACHE */ + #define NCACHE_PARADDR nc_dvp /* parent node address in NCACHE */ + +-# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) ++# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) + #define NCACHE_NXT nc_hash.le_next /* link in NCACHE */ +-# else /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */ ++# else /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ + # if defined(NetBSD1_0) && NetBSD<1994101 + #define NCACHE_NXT nc_nxt /* link in NCACHE */ + # else /* !defined(NetBSD1_0) || NetBSD>=1994101 */ + #define NCACHE_NXT nc_lru.tqe_next /* link in NCACHE */ + # endif /* defined(NetBSD1_0) && NetBSD<1994101 */ +-# endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */ ++# endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ + + # if defined(HASNCVPID) + #define NCACHE_PARID nc_dvpid /* parent node ID in NCACHE */ diff --git a/sysutils/lsof/patches/patch-ac b/sysutils/lsof/patches/patch-ac index ae3be3d5edf..51311ba3a36 100644 --- a/sysutils/lsof/patches/patch-ac +++ b/sysutils/lsof/patches/patch-ac @@ -1,30 +1,931 @@ -$NetBSD: patch-ac,v 1.19 2004/11/12 05:41:36 erh Exp $ +$NetBSD: patch-ac,v 1.20 2004/11/28 22:39:07 atatat Exp $ ---- Configure.orig 2004-10-19 19:36:21.000000000 +0000 -+++ Configure 2004-11-12 05:35:16.000000000 +0000 -@@ -2298,7 +2298,15 @@ +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. + +--- Configure.orig 2004-10-19 15:36:21.000000000 -0400 ++++ Configure +@@ -161,6 +161,7 @@ LSOF_TSTK64=0 + LSOF_TSTKMEM=1 + LSOF_TSTLFF="${LSOF_TSTSUBD}/config.ldflags" + LSOF_TSTLFLG="" ++LSOF_TSTVPATH=0 + LSOF_TSTXO="" + LSOF_TSTXOC="${LSOF_TSTSUBD}/config.xobj" + if test "X$LSOF_VERS" = "X" # { +@@ -2264,51 +2279,49 @@ return(0); } + # Validate the NetBSD version. + + case $LSOF_VSTR in # { +- 1.0*) +- LSOF_VERS="1000" +- ;; +- 1.1*) +- LSOF_VERS="1010" +- ;; + 1.2*) +- LSOF_VERS="1020" ++ LSOF_VERS="1002000" + ;; + 1.3*) +- LSOF_VERS="1030" ++ LSOF_VERS="1003000" + ;; + 1.4*) +- LSOF_VERS="1040" ++ LSOF_VERS="1004000" + ;; + 1.5*) + LSOF_TSTBIGF=" " +- LSOF_VERS="1050" ++ LSOF_VERS="1005000" + ;; + 1.6*) + LSOF_TSTBIGF=" " +- LSOF_VERS="1060" ++ LSOF_VERS="1006000" + ;; + 1*) +- LSOF_VERS=1060 ++ LSOF_VERS="1006000" + echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" + echo "!!!WARNING!!! Configuring for NetBSD 1.6" + ;; + 2.0*) + LSOF_TSTBIGF=" " +- LSOF_VERS="2000" ++ LSOF_VERS="2000000" ;; 2.99.9) LSOF_TSTBIGF=" " - LSOF_VERS="2999" -+ LSOF_VERS="2990" ++ LSOF_VERS="2099009" + ;; -+ 2.99.1[0-9]) ++ 2.99.10) + LSOF_TSTBIGF=" " -+ LSOF_VERS="2990" -+ if test -r ${LSOF_INCLUDE}/sys/bufq.h -+ then -+ LSOF_VERS="2991" -+ fi ++ LSOF_VERS="2099010" ;; 2*) - LSOF_VERS=2000 -@@ -2316,7 +2324,7 @@ +- LSOF_VERS=2000 ++ LSOF_VERS="2000000" + echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" + echo "!!!WARNING!!! Configuring for NetBSD 2.0" + ;; + *) + echo "Unknown NetBSD release: $LSOF_VSTR" +- echo Assuming NetBSD 1.0 +- LSOF_VERS="1000" ++ echo Assuming NetBSD 1.6 ++ LSOF_VERS="1006000" + ;; + esac # } + fi # } +@@ -2316,7 +2329,7 @@ return(0); } # Test for legal NetBSD version. case $LSOF_VERS in # { - 1000|1010|1020|1030|1040|1050|1060|2000|2999) -+ 1000|1010|1020|1030|1040|1050|1060|2000|2990|2991) ++ 1002000|1003000|1004000|1005000|1006000|2000000|2099009|2099010) ;; *) echo "Unknown NetBSD version: $LSOF_VERS" +@@ -2336,166 +2349,656 @@ return(0); } + fi # } + fi # } + LSOF_CFGF="$LSOF_CFGF $LSOF_TMP1" +- if test -r ${LSOF_INCLUDE}/nfs/nfsproto.h # { ++ if test -r ${LSOF_INCLUDE}/kvm.h # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASNFSPROTO" ++ grep -q kvm_getproc2 ${LSOF_INCLUDE}/kvm.h ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASKVMGETPROC2" ++ fi # } + fi # } +- if test -r ${LSOF_INCLUDE}/netinet/ip6.h # { ++ ++ # Here begin the dual tests on header files that may be in $LSOF_INCLUDE ++ # or $NETBSD_SYS. ++ # ++ # Note that $LSOF_TMP1 holds an indicator of the need for -I$NETBSD_SYS. ++ # LSOF_TMP4 contains a temporary indicator of the use of $NETBSD_SYS. ++ ++ LSOF_TMP1=0 ++ if test "X$NETBSD_SYS" = "X" # { ++ then ++ if test -d /usr/src/sys # { ++ then ++ NETBSD_SYS="/usr/src/sys" ++ else ++ NETBSD_SYS=$LSOF_INCLUDE ++ fi # } ++ fi # } ++ LSOF_TMP2="nfs/nfsproto.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASNFSPROTO" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ LSOF_TMP2="netinet/ip6.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { + then + LSOF_CFGF="$LSOF_CFGF -DHASIPv6" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ else ++ LSOF_TMP2="netinet/in.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ grep -q IPV6_INRIA_VERSION $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASIPv6 -DHASINRIAIPv6" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ fi # } + fi # } +- LSOF_TMP1=0 +- if test "X$NETBSD_SYS" = "X" # { ++ LSOF_TMP2="miscfs/fdesc/fdesc.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- NETBSD_SYS=$LSOF_INCLUDE ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } + fi # } +- if test -r ${NETBSD_SYS}/miscfs/fdesc/fdesc.h # { ++ if test "X$LSOF_TMP3" != "X" # { + then +- grep -q Fctty ${NETBSD_SYS}/miscfs/fdesc/fdesc.h ++ grep -q Fctty $LSOF_TMP3 + if test $? -eq 0 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASFDESCFS=1" + else + LSOF_CFGF="$LSOF_CFGF -DHASFDESCFS=2" + fi # } +- grep -q fd_link ${NETBSD_SYS}/miscfs/fdesc/fdesc.h ++ grep -q fd_link $LSOF_TMP3 + if test $? -eq 0 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASFDLINK" + fi # } +- LSOF_TMP1=1 ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } + fi # } +- if test -r ${LSOF_INCLUDE}/sys/vnode.h # { ++ LSOF_TMP2="miscfs/nullfs/null.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- grep -q VT_LFS ${LSOF_INCLUDE}/sys/vnode.h +- if test $? -eq 0 # { ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASLFS" ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" + fi # } + fi # } +- if test -r ${LSOF_INCLUDE}/miscfs/nullfs/null.h # { ++ if test "X$LSOF_TMP3" != "X" # { + then + LSOF_CFGF="$LSOF_CFGF -DHASNULLFS" +- else +- if test -r ${NETBSD_SYS}/miscfs/nullfs/null.h # { ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASNULLFS" + LSOF_TMP1=1 + fi # } + fi # } +- if test -d ${NETBSD_SYS}/miscfs/procfs # { ++ LSOF_TMP2="miscfs/procfs" ++ if test -d ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -d ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { + then + LSOF_CFGF="$LSOF_CFGF -DHASPROCFS" +- LSOF_TMP1=1 +- grep -q PFSroot ${NETBSD_SYS}/miscfs/procfs/procfs.h +- if test $? -eq 0 # { ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ if test -r ${LSOF_TMP3}/procfs.h # { ++ then ++ grep -q PFSroot ${LSOF_TMP3}/procfs.h ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASPROCFS_PFSROOT" ++ fi # } ++ fi # } ++ fi # } ++ LSOF_TMP2="sys/bufq.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASPROCFS_PFSROOT" +- fi # } ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } + fi # } +- if test -d ${NETBSD_SYS}/isofs/cd9660 # { ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASBUFQ_H" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ LSOF_TMP2="fs/ptyfs/ptyfs.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASPTYFS" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ LSOF_TMP2="isofs/cd9660" ++ if test -d ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -d ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { + then + LSOF_CFGF="$LSOF_CFGF -DHAS9660FS=1" +- LSOF_TMP1=1 ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } + else +- if test -d ${NETBSD_SYS}/fs/cd9660 # { ++ LSOF_TMP2="fs/cd9660" ++ if test -d ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHAS9660FS=2" +- LSOF_TMP1=1 ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -d ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHAS9660FS=1" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ fi # } ++ LSOF_TMP2="msdosfs" ++ if test -d ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -d ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" + fi # } + fi # } +- if test -d ${NETBSD_SYS}/msdosfs # { ++ if test "X$LSOF_TMP3" != "X" # { + then + LSOF_CFGF="$LSOF_CFGF -DHASMSDOSFS=1" +- LSOF_TMP1=1 ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } + else +- if test -d ${NETBSD_SYS}/fs/msdosfs # { ++ LSOF_TMP2="fs/msdosfs" ++ if test -d ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASMSDOSFS=2" +- LSOF_TMP1=1 ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -d ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASMSDOSFS=2" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } + fi # } + fi # } +- if test -r ${NETBSD_SYS}/miscfs/kernfs/kernfs.h # { ++ LSOF_TMP2="miscfs/kernfs/kernfs.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- grep -q "kt_name;" ${NETBSD_SYS}/miscfs/kernfs/kernfs.h ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ grep -q "kt_name;" $LSOF_TMP3 + if test $? -eq 0 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASKERNFS" +- LSOF_TMP1=1 +- grep -q "*kfs_kt;" ${NETBSD_SYS}/miscfs/kernfs/kernfs.h ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ grep -q "*kfs_kt;" $LSOF_TMP3 + if test $? -eq 0 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASKERNFS_KFS_KT" + fi # } + fi # } + fi # } +- if test $LSOF_TMP1 -eq 1 -a "X$LSOF_INCLUDE" != "X$NETBSD_SYS" # { ++ LSOF_TMP2="sys/namei.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- LSOF_DINC="-I$LSOF_INCLUDE -I$NETBSD_SYS" ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } + fi # } +- if test -r ${LSOF_INCLUDE}/sys/namei.h ++ if test "X$LSOF_TMP3" != "X" # { + then +- grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h ++ grep -q nc_vpid $LSOF_TMP3 + if test $? -eq 0 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASNCVPID" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } + fi # } + fi # } +- grep -q i_ffs_size ${LSOF_INCLUDE}/ufs/ufs/inode.h +- if test $? -eq 0 # { ++ LSOF_TMP2="ufs/ufs/inode.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASI_FFS" ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 + else +- grep -q i_ffs1_size ${LSOF_INCLUDE}/ufs/ufs/inode.h +- if test $? -eq 0 # { ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASI_FFS1" +- fi #} ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } + fi # } +- grep -q VT_EXT2FS ${LSOF_INCLUDE}/sys/vnode.h +- if test $? -eq 0 # { ++ if test "X$LSOF_TMP3" != "X" # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASEXT2FS" +- grep -q "*e2fs_din" ${LSOF_INCLUDE}/ufs/ufs/inode.h ++ grep -q i_ffs_size $LSOF_TMP3 + if test $? -eq 0 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASI_E2FS_PTR" ++ LSOF_CFGF="$LSOF_CFGF -DHASI_FFS" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ else ++ grep -q i_ffs1_size $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASI_FFS1" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } + fi # } + fi # } +- if test -r ${LSOF_INCLUDE}/nfs/nfsnode.h # { ++ LSOF_TMP2="sys/vnode.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then +- grep -q "*n_vattr" ${LSOF_INCLUDE}/nfs/nfsnode.h +- if test $? -eq 0 # { ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { + then +- LSOF_CFGF="$LSOF_CFGF -DHASNFSVATTRP" ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" + fi # } + fi # } +- if test "X$NETBSD_UVM" = "X" # { ++ if test "XLSOF_TMP3" != "X" # { + then +- if test -r /etc/mk.conf # { ++ grep -q VT_EXT2FS $LSOF_TMP3 ++ if test $? -eq 0 # { + then +- grep -q "^UVM[ ]*=" /etc/mk.conf +- if test $? -eq 0 # { ++ LSOF_CFGF="$LSOF_CFGF -DHASEXT2FS" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { + then +- NETBSD_UVM="Y" ++ LSOF_TMP1=1 ++ fi # } ++ LSOF_TMP2="ufs/ufs/inode.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP5="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP6=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP5="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP6=1 ++ else ++ LSOF_TMP5="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP5" != "X" # { ++ then ++ grep -q "*e2fs_din" $LSOF_TMP5 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASI_E2FS_PTR" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=$LSOF_TMP6 ++ fi # } ++ fi # } ++ fi # } ++ fi # } ++ grep -q VT_LFS $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASLFS" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 + fi # } + fi # } + if test "X$NETBSD_UVM" = "X" # { + then +- if test -r ${LSOF_INCLUDE}/sys/vnode.h # { ++ grep -q UVM $LSOF_TMP3 ++ if test $? -ne 0 # { + then +- grep -q UVM ${LSOF_INCLUDE}/sys/vnode.h +- if test $? -ne 0 # { ++ egrep -q "v_uvm;|v_uobj;" $LSOF_TMP3 ++ if test $? -eq 0 # { + then +- egrep -q "v_uvm;|v_uobj;" ${LSOF_INCLUDE}/sys/vnode.h +- if test $? -eq 0 # { +- then +- NETBSD_UVM="Y" +- fi # } ++ NETBSD_UVM="Y" + fi # } + fi # } + fi # } + fi # } ++ LSOF_TMP2="nfs/nfsnode.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ grep -q "*n_vattr" $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASNFSVATTRP" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ fi # } ++ LSOF_TMP2="sys/lockf.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ grep -q vop_advlock_args $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHAS_ADVLOCK_ARGS" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ grep -q lf_lwp $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHAS_LF_LWP" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ fi # } ++ LSOF_TMP2="sys/lwp.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHAS_LWP_H" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ LSOF_TMP2="sys/filedesc.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ grep -q "^struct cwdinfo {" $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASCWDINFO" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ fi # } ++ LSOF_TMP2="sys/pipe.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHAS_SYS_PIPEH" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ LSOF_TMP2="sys/statvfs.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { ++ then ++ grep -q '^struct statvfs {' $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASSTATVFS" ++ if test $LSOF_TMP1 -eq 0 -a $LSOF_TMP4 -eq 1 # { ++ then ++ LSOF_TMP1=1 ++ fi # } ++ fi # } ++ fi # } ++ ++ # Here end the dual NetBSD tests for header files in $LSOF_INCLUDE or ++ # NETBSD_SYS. ++ # ++ # After this LSOF_TMP1 may be reused. ++ ++ if test $LSOF_TMP1 -eq 1 # { ++ then ++ LSOF_DINC="-I$LSOF_INCLUDE -I$NETBSD_SYS" ++ fi # } ++ ++ # Build special header files, as required. ++ + rm -rf dialects/n+obsd/include + if test "X$NETBSD_UVM" = "XY" -o "X$NETBSD_UVM" = "Xy" # { + then +@@ -2508,7 +3011,21 @@ return(0); } + LSOF_CFGF="$LSOF_CFGF -DHAS_UVM_INCL" + fi # } + fi # } +- if test -r ${LSOF_INCLUDE}/sys/mount.h # { ++ LSOF_TMP2="sys/mount.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" ++ LSOF_TMP4=0 ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ LSOF_TMP3="${NETBSD_SYS}/$LSOF_TMP2" ++ LSOF_TMP4=1 ++ else ++ LSOF_TMP3="" ++ fi # } ++ fi # } ++ if test "X$LSOF_TMP3" != "X" # { + then + + # Build the netexport.h header file for NetBSD. +@@ -2553,59 +3070,6 @@ return(0); } + if test $? -ne 0 # { + then + LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include" +- fi +- fi # } +- if test -r ${LSOF_INCLUDE}/sys/lockf.h # { +- then +- grep vop_advlock_args ${LSOF_INCLUDE}/sys/lockf.h > /dev/null +- if test $? -eq 0 # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHAS_ADVLOCK_ARGS" +- fi # } +- grep lf_lwp ${LSOF_INCLUDE}/sys/lockf.h > /dev/null +- if test $? -eq 0 # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHAS_LF_LWP" +- fi # } +- fi # } +- if test -r ${LSOF_INCLUDE}/sys/lwp.h # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHAS_LWP_H" +- fi # } +- if test -r ${LSOF_INCLUDE}/netinet/in.h # { +- then +- grep IPV6_INRIA_VERSION ${LSOF_INCLUDE}/netinet/in.h > /dev/null +- if test $? -eq 0 # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHASIPv6 -DHASINRIAIPv6" +- fi # } +- fi # } +- if test -r ${LSOF_INCLUDE}/sys/filedesc.h # { +- then +- grep -q "^struct cwdinfo {" ${LSOF_INCLUDE}/sys/filedesc.h +- if test $? -eq 0 # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHASCWDINFO" +- fi # } +- fi # } +- if test -r ${LSOF_INCLUDE}/sys/pipe.h # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHAS_SYS_PIPEH" +- fi # } +- if test -r ${LSOF_INCLUDE}/sys/statvfs.h # { +- then +- grep -q '^struct statvfs {' ${LSOF_INCLUDE}/sys/statvfs.h +- if test $? -eq 0 # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHASSTATVFS" +- fi # } +- fi # } +- if test -r ${LSOF_INCLUDE}/kvm.h # { +- then +- grep -q kvm_getproc2 ${LSOF_INCLUDE}/kvm.h +- if test $? -eq 0 # { +- then +- LSOF_CFGF="$LSOF_CFGF -DHASKVMGETPROC2" + fi # } + fi # } + LSOF_CFGL="$LSOF_CFGL -lkvm" +@@ -3594,6 +4058,15 @@ return(0); } + # DEBUG -- End temporary hack for Solaris 10, build s10_44. + + fi # } ++ if test -r ${LSOF_INCLUDE}/sys/vnode.h # { ++ then ++ grep v_path ${LSOF_INCLUDE}/sys/vnode.h > /dev/null 2>&1 ++ if test $? -eq 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHAS_V_PATH" ++ LSOF_TSTVPATH=1 ++ fi # } ++ fi # } + fi # } + if test -r ${LSOF_INCLUDE}/sys/zone.h # { + then +@@ -4192,6 +4665,10 @@ then + echo "-DLT_K64" >> $LSOF_TSTCFLG + fi # } + echo "-DLT_VERS=$LSOF_VERS" >> $LSOF_TSTCFLG ++if test $LSOF_TSTVPATH -eq 1 # { ++then ++ echo "-DLT_VPATH" >> $LSOF_TSTCFLG ++fi # } + echo "$LSOF_TSTCFLG created" + + # Create tests loader flags file. diff --git a/sysutils/lsof/patches/patch-ad b/sysutils/lsof/patches/patch-ad new file mode 100644 index 00000000000..718f5f8e081 --- /dev/null +++ b/sysutils/lsof/patches/patch-ad @@ -0,0 +1,25 @@ +$NetBSD: patch-ad,v 1.9 2004/11/28 22:39:07 atatat Exp $ + +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. + +--- dialects/n+obsd/dmnt.c.orig 2004-07-06 15:20:20.000000000 -0400 ++++ dialects/n+obsd/dmnt.c +@@ -36,6 +36,15 @@ static char *rcsid = "$Id: dmnt.c,v 1.10 + #endif + + ++#if defined(NETBSDV) && defined(HASSTATVFS) ++/* ++ * NetBSD needs the statvfs structure to be defined without the ++ * pre-definition of _KERNEL. ++ */ ++ ++#include <sys/statvfs.h> ++#endif /* defined(NETBSDV) && defined(HASSTATVFS) */ ++ + #include "lsof.h" + + diff --git a/sysutils/lsof/patches/patch-ae b/sysutils/lsof/patches/patch-ae new file mode 100644 index 00000000000..66b92b5e55c --- /dev/null +++ b/sysutils/lsof/patches/patch-ae @@ -0,0 +1,161 @@ +$NetBSD: patch-ae,v 1.5 2004/11/28 22:39:07 atatat Exp $ + +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. + +--- dialects/n+obsd/dnode.c.orig 2004-07-06 15:20:23.000000000 -0400 ++++ dialects/n+obsd/dnode.c +@@ -188,7 +188,7 @@ process_node(va) + struct mfsnode m; + struct nfsnode n; + enum nodetype {NONODE, CDFSNODE, DOSNODE, EXT2NODE, FDESCNODE, INODE, +- KERNFSNODE, MFSNODE, NFSNODE, PFSNODE} nty; ++ KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE} nty; + enum vtype type; + struct vnode *v, vb; + struct l_vfs *vfs; +@@ -262,6 +262,11 @@ process_node(va) + size_t sz; + #endif /* defined(HASPROCFS) */ + ++#if defined(HASPTYFS) ++ struct ptyfsnode pt; ++ struct specinfo si; ++#endif /* defined(HASPTYFS) */ ++ + #if defined(HASNULLFS) + + process_overlaid_node: +@@ -523,6 +528,19 @@ process_overlaid_node: + break; + #endif /* defined(HASPROCFS) */ + ++#if defined(HASPTYFS) ++ case VT_PTYFS: ++ if (!v->v_data ++ || kread((KA_T)v->v_data, (char *)&pt, sizeof(pt))) { ++ (void) snpf(Namech, Namechl, "can't read ptyfsnode at: %s", ++ print_kptr((KA_T)v->v_data, (char *)NULL, 0)); ++ enter_nm(Namech); ++ return; ++ } ++ nty = PTYFSNODE; ++ break; ++#endif /* defined(HASPTYFS) */ ++ + #if defined(HASEXT2FS) + case VT_EXT2FS: + #endif /* defined(HASEXT2FS) */ +@@ -769,6 +787,21 @@ process_overlaid_node: + case NFSNODE: + dev = NVATTR.va_fsid; + devs = 1; ++ ++#if defined(HASPTYFS) ++ case PTYFSNODE: ++ if (v->v_un.vu_specinfo ++ && !kread((KA_T)v->v_un.vu_specinfo, (char *)&si, sizeof(si))) { ++ rdev = si.si_rdev; ++ rdevs = 1; ++ } ++ if (vfs) { ++ dev = (dev_t)vfs->fsid.__fsid_val[0]; ++ devs = 1; ++ } ++ break; ++#endif /* defined(HASPTYFS) */ ++ + } + /* + * Obtain the inode number. +@@ -836,6 +869,13 @@ process_overlaid_node: + break; + #endif /* defined(HASPROCFS) */ + ++#if defined(HASPTYFS) ++ case PTYFSNODE: ++ Lf->inode = (unsigned long)pt.ptyfs_fileno; ++ Lf->inp_ty = 1; ++ break; ++#endif /* defined(HASPTYFS) */ ++ + } + + /* +@@ -1152,7 +1192,8 @@ process_overlaid_node: + * ioctl(fd, TIOCNOTTY) files; + * /kern files + * memory node files; +- * /proc files. ++ * /proc files; ++ * ptyfs files. + */ + + if (type == VBAD) +@@ -1222,14 +1263,52 @@ process_overlaid_node: + (void) snpf(ep, sz, "/%d/notepg", p.pfs_pid); + ty = "PGID"; + break; ++ case Pfd: ++ ep = endnm(&sz); ++ (void) snpf(ep, sz, "/%d/fd", p.pfs_pid); ++ ty = "PFD"; ++ break; ++ case Pmap: ++ ep = endnm(&sz); ++ (void) snpf(ep, sz, "/%d/map", p.pfs_pid); ++ ty = "PMAP"; ++ break; ++ case Pmaps: ++ ep = endnm(&sz); ++ (void) snpf(ep, sz, "/%d/maps", p.pfs_pid); ++ ty = "PMPS"; ++ break; + } + if (ty) + (void) snpf(Lf->type, sizeof(Lf->type), ty); +- if (Namech[0]) +- enter_nm(Namech); + } + #endif /* defined(HASPROCFS) */ + ++#if defined(HASPTYFS) ++ else if (nty == PTYFSNODE) { ++ (void) snpf(Namech, Namechl, "%s", Lf->fsdir); ++ Lf->nlink = 1; ++ Lf->nlink_def = 1; ++ switch (pt.ptyfs_type) { ++ case PTYFSpts: ++ ep = endnm(&sz); ++ (void) snpf(ep, sz, "/%lu", (unsigned long)pt.ptyfs_pty); ++ break; ++ case PTYFSptc: ++ ep = endnm(&sz); ++ (void) snpf(ep, sz, "/%lu (master)", ++ (unsigned long)pt.ptyfs_pty); ++ break; ++ case PTYFSroot: ++ Lf->sz = 512; ++ Lf->sz_def = 1; ++ break; ++ } ++ if (ty) ++ (void) snpf(Lf->type, sizeof(Lf->type), ty); ++ } ++#endif /* defined(HASPTYFS) */ ++ + #if defined(HASBLKDEV) + /* + * If this is a VBLK file and it's missing an inode number, try to +@@ -1283,7 +1362,9 @@ process_overlaid_node: + if (Sfile && is_file_named((char *)NULL, + ((type == VCHR) || (type == VBLK)) ? 1 + : 0)) ++ { + Lf->sf |= SELNM; ++ } + if (ns) + Namech[0] = '\0'; + } diff --git a/sysutils/lsof/patches/patch-af b/sysutils/lsof/patches/patch-af new file mode 100644 index 00000000000..53744f21dde --- /dev/null +++ b/sysutils/lsof/patches/patch-af @@ -0,0 +1,21 @@ +$NetBSD: patch-af,v 1.4 2004/11/28 22:39:07 atatat Exp $ + +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. + +--- dialects/n+obsd/dsock.c.orig 2004-03-10 18:51:38.000000000 -0500 ++++ dialects/n+obsd/dsock.c +@@ -79,9 +79,9 @@ process_socket(sa) + #define UNPADDR_IN_MBUF + + #if defined(NETBSDV) +-# if NETBSDV>=1040 ++# if NETBSDV>=1004000 + #undef UNPADDR_IN_MBUF +-# endif /* NETBSDV>=1040 */ ++# endif /* NETBSDV>=1004000 */ + #endif /* defined(NETBSDV) */ + + #if defined(UNPADDR_IN_MBUF) diff --git a/sysutils/lsof/patches/patch-ag b/sysutils/lsof/patches/patch-ag new file mode 100644 index 00000000000..536ffe201d2 --- /dev/null +++ b/sysutils/lsof/patches/patch-ag @@ -0,0 +1,31 @@ +$NetBSD: patch-ag,v 1.1 2004/11/28 22:39:07 atatat Exp $ + +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. + +--- dialects/n+obsd/dstore.c.orig 2003-10-07 10:34:32.000000000 -0400 ++++ dialects/n+obsd/dstore.c +@@ -49,10 +49,10 @@ struct file *Cfp; /* current file's fil + + struct drive_Nl Drive_Nl[] = { + +-#if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) ++#if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) + { X_NCACHE, "_nchashtbl", }, + { X_NCSIZE, "_nchash" }, +-#else /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */ ++#else /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ + # if defined(NetBSD1_0) && NetBSD<1994101 + { X_NCACHE, "_nchhead", }, + # else /* !defined(NetBSD1_0) || NetBSD>=1994101 */ +@@ -60,7 +60,7 @@ struct drive_Nl Drive_Nl[] = { + # endif /* defined(NetBSD1_0) && NetBSD<1994101 */ + + { X_NCSIZE, "_numcache" }, +-#endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */ ++#endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ + + { "pgshift", "_pgshift" }, + { "", "" }, diff --git a/sysutils/lsof/patches/patch-ah b/sysutils/lsof/patches/patch-ah new file mode 100644 index 00000000000..1dc988172c8 --- /dev/null +++ b/sysutils/lsof/patches/patch-ah @@ -0,0 +1,45 @@ +$NetBSD: patch-ah,v 1.1 2004/11/28 22:39:07 atatat Exp $ + +Incorporate a patch from the author that widens the NETBSDV definition +to account for new current versioning system, properly handles the +sys/bufq.h mess, adds a bit more to procfs support, and adds ptyfs +support. + +--- lsof.h.orig 2004-07-15 10:56:50.000000000 -0400 ++++ lsof.h +@@ -297,20 +297,21 @@ static struct utmp dummy_utmp; /* to ge + #define N_MPC 19 /* multiplexed device node */ + #define N_MVFS 20 /* multi-volume file system node (?) */ + #define N_NFS 21 /* NFS node */ +-#define N_NM 22 /* named file system node */ +-#define N_OBJF 23 /* objfs file system node */ +-#define N_PCFS 24 /* PC file system node */ +-#define N_PIPE 25 /* pipe device node */ +-#define N_PROC 26 /* /proc node */ +-#define N_PSEU 27 /* pseudofs node */ +-#define N_SAMFS 28 /* Solaris SAM-FS */ +-#define N_SOCK 29 /* sock_vnodeops node */ +-#define N_SPEC 30 /* spec_vnodeops node */ +-#define N_STREAM 31 /* stream node */ +-#define N_TMP 32 /* tmpfs node */ +-#define N_UFS 33 /* UNIX file system node */ +-#define N_VXFS 34 /* Veritas file system node */ +-#define N_XFS 35 /* XFS node */ ++#define N_NFS4 22 /* NFS version 4 node */ ++#define N_NM 23 /* named file system node */ ++#define N_OBJF 24 /* objfs file system node */ ++#define N_PCFS 25 /* PC file system node */ ++#define N_PIPE 26 /* pipe device node */ ++#define N_PROC 27 /* /proc node */ ++#define N_PSEU 28 /* pseudofs node */ ++#define N_SAMFS 29 /* Solaris SAM-FS */ ++#define N_SOCK 30 /* sock_vnodeops node */ ++#define N_SPEC 31 /* spec_vnodeops node */ ++#define N_STREAM 32 /* stream node */ ++#define N_TMP 33 /* tmpfs node */ ++#define N_UFS 34 /* UNIX file system node */ ++#define N_VXFS 35 /* Veritas file system node */ ++#define N_XFS 36 /* XFS node */ + + # if !defined(OFFDECDIG) + #define OFFDECDIG 8 /* maximum number of digits in the |