Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

5
sysutils/lsof/DESCR Normal file
View File

@@ -0,0 +1,5 @@
Lsof (LiSt Open Files) lists information about files that are open by the
running processes. An open file may be a regular file, a directory, a block
special file, a character special file, an executing text reference, a
library, a stream or a network file (Internet socket, NFS file or Unix domain
socket), a kqueue descriptor...

106
sysutils/lsof/Makefile Normal file
View File

@@ -0,0 +1,106 @@
# $NetBSD: Makefile,v 1.114 2013/05/31 12:42:01 wiz Exp $
DISTNAME= lsof_4.84
PKGNAME= ${DISTNAME:S/_/-/}
PKGREVISION= 3
CATEGORIES= sysutils
MASTER_SITES= ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ \
ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/ \
ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/ \
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/ \
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/NEW/ \
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/OLD/ \
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/ \
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/NEW/ \
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/OLD/ \
ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/ \
ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/NEW/ \
ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/OLD/ \
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ \
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/NEW/ \
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/OLD/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://people.freebsd.org/~abe/
COMMENT= Lists information about open files
WRKSRC= ${WRKDIR}/${DISTNAME}/${SRCBALL_NAME}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= ./Configure
CONFIGURE_ARGS+= -n ${LOWER_OPSYS}
CONFIGURE_ENV+= LSOF_CC="${CC} ${CFLAGS}"
MAKE_FLAGS+= LSOF_BLDCMT="NetBSD pkgsrc rocks!"
OSVERSION_SPECIFIC= yes
TMPWRK= ${WRKDIR}/${DISTNAME}
SRCBALL_NAME= ${DISTNAME}_src
REPLACE_PERL+= scripts/sort_res.perl5 scripts/count_pf.perl5 \
scripts/list_NULf.perl5 scripts/big_brother.perl5 \
scripts/identd.perl5 scripts/shared.perl5 \
scripts/idrlogin.perl5 scripts/count_pf.perl \
scripts/idrlogin.perl scripts/list_fields.perl \
scripts/watch_a_file.perl
USE_TOOLS+= gtar pax perl:run
PKG_INSTALLATION_TYPES= overwrite pkgviews
TEST_DIRS= tests
TEST_TARGET= test
INTERACTIVE_STAGE+= test
.include "../../mk/bsd.prefs.mk"
.include "options.mk"
REAL_GROUP= ${REAL_ROOT_GROUP}
.if ${OPSYS} == "NetBSD"
REAL_GROUP= kmem
CONFIGURE_ENV+= NETBSD_SYS="${NETBSDSRCDIR}/sys"
CPPFLAGS+= -D_KMEMUSER
.elif ${OPSYS} == "FreeBSD"
BUILDLINK_PASSTHRU_DIRS+= /usr/src/sys
.elif ${OPSYS} == "SunOS"
MAKE_ENV+= CPPFLAGS=
.endif
INSTALLATION_DIRS= ${PKGMANDIR}/man8 sbin
post-extract:
.if ${OPSYS} == "FreeBSD"
@(if [ ! -x /usr/src/sys ]; then \
${ECHO} "Lsof requires kernel sources to be found in /usr/src/sys." ; \
exit 1 ; \
fi)
.endif
@(cd ${TMPWRK} ; \
EXPMD5=`${GREP} 'MD5 (' README.${DISTNAME} | ${SED} 's/^[ ]*//'` ; \
CALCMD5=`${DIGEST} MD5 ${SRCBALL_NAME}.tar` ; \
if [ "$${EXPMD5}"X != "$${CALCMD5}"X ]; then \
${ECHO} "Expected and calculated MD5 signatures don't agree." ; \
${ECHO} "($$EXPMD5 != $$CALCMD5)" ; \
exit 1 ; \
fi ; \
if [ X${EXTRACT_USING} = Xgtar ]; then \
${GTAR} -xf ${SRCBALL_NAME}.tar; \
else \
pax -O -r < ${SRCBALL_NAME}.tar; \
fi)
@( cd ${WRKSRC} ; ${ECHO} "y" | ./Inventory || exit 1 )
INSTALLATION_DIRS+= sbin ${PKGMANDIR}/man8 share/lsof
SPECIAL_PERMS+= ${PREFIX}/sbin/lsof ${REAL_ROOT_USER} ${REAL_GROUP} 2755
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/lsof ${DESTDIR}${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/lsof.8 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/lsof.8
${INSTALL_SCRIPT} ${WRKSRC}/scripts/* ${DESTDIR}${PREFIX}/share/lsof
@${CHMOD} 0444 ${DESTDIR}${PREFIX}/share/lsof/00*
opt:
.for _dir_ in ${TEST_DIRS}
${RUN}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
${TEST_MAKE_CMD} opt
.endfor
.include "../../mk/bsd.pkg.mk"

18
sysutils/lsof/PLIST Normal file
View File

@@ -0,0 +1,18 @@
@comment $NetBSD: PLIST,v 1.5 2009/06/14 18:16:09 joerg Exp $
sbin/lsof
man/man8/lsof.8
share/lsof/00MANIFEST
share/lsof/00README
share/lsof/big_brother.perl5
share/lsof/count_pf.perl
share/lsof/count_pf.perl5
share/lsof/identd.perl5
share/lsof/idrlogin.perl
share/lsof/idrlogin.perl5
share/lsof/list_NULf.perl5
share/lsof/list_fields.awk
share/lsof/list_fields.perl
share/lsof/shared.perl5
share/lsof/sort_res.perl5
share/lsof/watch_a_file.perl
share/lsof/xusers.awk

14
sysutils/lsof/distinfo Normal file
View File

@@ -0,0 +1,14 @@
$NetBSD: distinfo,v 1.83 2013/04/20 21:48:47 dholland Exp $
SHA1 (lsof_4.84.tar.bz2) = b4fd6011fc183c0602bbba2116b8335a0c57917b
RMD160 (lsof_4.84.tar.bz2) = c7df81cb9c83d4e03db395397912138953529510
Size (lsof_4.84.tar.bz2) = 758615 bytes
SHA1 (patch-aa) = 4469a5fed540e3c5635b6082efedc477ea96a382
SHA1 (patch-ab) = 1501d8b0e6fd2c61949ba0d447c7b726655725c4
SHA1 (patch-ac) = dac0fcdfee97d42c8f23684a4321519b9f8698d9
SHA1 (patch-ad) = 4bd73dea4770c7f5a43be0d096c26e7d6728dd2c
SHA1 (patch-ae) = 1d8c1c3baf9575631c23d3ced7b12fab1df95cd6
SHA1 (patch-af) = b52c15a507960ecf33a61a3cbd608a92ebac1188
SHA1 (patch-ag) = 5a48b4036d65af7cb6da0a1c89e06f02ae921ac6
SHA1 (patch-ah) = 2de22b9a3733f958298af5e33b66c0653c320f59
SHA1 (patch-dialects_n+obsd_dnode1.c) = dc8c766760aca4eb2e7d7af3944260dd49795c09

39
sysutils/lsof/options.mk Normal file
View File

@@ -0,0 +1,39 @@
# $NetBSD: options.mk,v 1.1 2010/04/30 06:53:06 sbd Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.lsof
PKG_SUPPORTED_OPTIONS= lsof-more-secure lsof-less-secure-sockets
.if defined(LSOF_MORE_SECURE)
. if !empty(LSOF_MORE_SECURE:M1)
PKG_LEGACY_OPTIONS+= lsof-more-secure
PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_MORE_SECURE set to 1, use PKG_OPTIONS.lsof+=lsof-more-secure instead."
. elif !empty(LSOF_MORE_SECURE:M0)
PKG_LEGACY_OPTIONS+= -lsof-more-secure
PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_MORE_SECURE set to 0, use PKG_OPTIONS.lsof+=-lsof-more-secure instead."
. endif
.endif
.if defined(LSOF_LESS_SECURE_SOCKETS)
. if !empty(LSOF_LESS_SECURE_SOCKETS:M1)
PKG_LEGACY_OPTIONS+= lsof-less-secure-sockets
PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_LESS_SECURE_SOCKETS set to 1, use PKG_OPTIONS.lsof+=lsof-less-secure-sockets instead."
. elif !empty(LSOF_LESS_SECURE_SOCKETS:M0)
PKG_LEGACY_OPTIONS+= -lsof-less-secure-sockets
PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_LESS_SECURE_SOCKETS set to 0, use PKG_OPTIONS.lsof+=lsof-less-secure-sockets instead."
. endif
.endif
.include "../../mk/bsd.options.mk"
## Emulate what ./Customize does.
post-configure:
${RUN} cd ${WRKSRC}; ${MV} -f machine.h machine.h.orig ; \
${CAT} machine.h.orig > machine.h ; \
${ECHO} "#undef HASSECURITY" >> machine.h ; \
${ECHO} "#undef HASNOSOCKSECURITY" >> machine.h ;
.if !empty(PKG_OPTIONS:Mlsof-more-secure)
${ECHO} "#define HASSECURITY 1" >> ${WRKSRC}/machine.h
. if !empty(PKG_OPTIONS:Mlsof-less-secure-sockets)
${ECHO} "#define HASNOSOCKSECURITY 1" >> ${WRKSRC}/machine.h
. endif
.endif

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-aa,v 1.28 2010/04/30 06:53:07 sbd Exp $
--- dialects/n+obsd/machine.h.orig 2006-03-28 16:54:17.000000000 -0500
+++ dialects/n+obsd/machine.h 2008-05-17 18:53:29.000000000 -0400
@@ -41,6 +41,10 @@
#include <sys/types.h>
#include <sys/param.h>
+#include <stdbool.h>
+#if __NetBSD_Version__ >= 499006200
+#define HASCWDINFO
+#endif
/*

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-ab,v 1.37 2005/09/15 02:45:13 atatat Exp $
--- dialects/darwin/get-hdr-loc.sh.orig 2005-05-27 16:18:54.000000000 -0400
+++ dialects/darwin/get-hdr-loc.sh
@@ -48,10 +48,9 @@ do
echo "and then installed. (See 00FAQ for download and installation" 1>&2
echo "instructions.)" 1>&2
echo "" 1>&2
- echo "Please specify the path to the place where they were installed." 1>&2
- echo "" 1>&2
echo "---------------------------------------------------------------" 1>&2
fi # }
+ exit 1
END=0
while test $END = 0 # {

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.29 2008/05/17 23:53:29 christos Exp $
--- dialects/n+obsd/dstore.c.orig 2004-12-30 13:42:32.000000000 -0500
+++ dialects/n+obsd/dstore.c 2008-05-17 19:35:34.000000000 -0400
@@ -119,6 +119,8 @@
# if defined(UF_EXCLOSE)
{ (long)UF_EXCLOSE, POF_CLOEXEC },
+# else
+ { (long)1, POF_CLOEXEC },
# endif /* defined(UF_EXCLOSE) */
# if defined(UF_MAPPED)

View File

@@ -0,0 +1,137 @@
$NetBSD: patch-ad,v 1.15 2008/05/17 23:53:29 christos Exp $
--- dialects/n+obsd/dnode.c.orig 2007-04-24 12:22:06.000000000 -0400
+++ dialects/n+obsd/dnode.c 2008-05-17 18:49:56.000000000 -0400
@@ -38,6 +38,9 @@
#include "lsof.h"
+#if __NetBSD_Version__ > 399001800
+#define NOLOCKF
+#endif
#if defined(HAS_DINODE_U)
#define DINODE_U dinode_u
@@ -194,12 +197,17 @@
unsigned char ns;
unsigned char rdevs;
char *ep, *ty;
+#ifndef NOLOCKF
struct lockf lf, *lff, *lfp;
+#endif
struct inode i;
struct mfsnode m;
+#if defined(HASTMPFS)
+ struct tmpfs_node tmp;
+#endif /* defined(HASTMPFS) */
struct nfsnode n;
enum nodetype {NONODE, CDFSNODE, DOSNODE, EXT2NODE, FDESCNODE, INODE,
- KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE} nty;
+ KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE, TMPFSNODE} nty;
enum vtype type;
struct vnode *v, vb;
struct l_vfs *vfs;
@@ -276,6 +284,11 @@
#if defined(HASPTYFS)
struct ptyfsnode pt;
+#if __NetBSD_Version__ >= 499006200
+#define specinfo specnode
+#define vu_specinfo vu_specnode
+#define si_rdev sn_rdev
+#endif
struct specinfo si;
#endif /* defined(HASPTYFS) */
@@ -414,7 +427,7 @@
*/
if (!v->v_data
|| kread((KA_T)v->v_data, (char *)&kn, sizeof(kn))) {
- if (v->v_type != VDIR || !(v->v_flag && VROOT)) {
+ if (v->v_type != VDIR || !(v->VNODE_VFLAG && NCACHE_VROOT)) {
(void) snpf(Namech, Namechl,
"can't read kernfs_node at: %s",
print_kptr((KA_T)v->v_data, (char *)NULL, 0));
@@ -449,7 +462,7 @@
* size are fixed; otherwise, safely stat() the file to get the
* inode number and size.
*/
- if (v->v_type == VDIR && (v->v_flag & VROOT)) {
+ if (v->v_type == VDIR && (v->VNODE_VFLAG & NCACHE_VROOT)) {
(void) snpf(Namech, Namechl, "%s", _PATH_KERNFS);
ksb.st_ino = (ino_t)2;
ksb.st_size = DEV_BSIZE;
@@ -471,6 +484,19 @@
nty = MFSNODE;
break;
+#if defined(HASTMPFS)
+ case VT_TMPFS:
+ if (!v->v_data
+ || kread((KA_T)v->v_data, (char *)&tmp, sizeof(tmp))) {
+ (void) snpf(Namech, Namechl, "can't read tmpfs_node at: %s",
+ print_kptr((KA_T)v->v_data, (char *)NULL, 0));
+ enter_nm(Namech);
+ return;
+ }
+ nty = TMPFSNODE;
+ break;
+#endif /* defined(HASTMPFS) */
+
#if defined(HASMSDOSFS)
case VT_MSDOSFS:
if (!v->v_data
@@ -619,6 +645,7 @@
}
+#ifndef NOLOCKF
if ((lff = i.i_lockf)) {
/*
@@ -667,6 +694,7 @@
break;
} while ((lfp = lf.lf_next) && lfp != lff);
}
+#endif
break;
default:
if (v->v_type == VBAD || v->v_type == VNON)
@@ -900,6 +928,13 @@
break;
#endif /* defined(HASPTYFS) */
+#if defined(HASTMPFS)
+ case TMPFSNODE:
+ Lf->inode = (INODETYPE)tmp.tn_id;
+ Lf->inp_ty = 1;
+ break;
+#endif /* defined(HASTMPFS) */
+
}
/*
@@ -1019,6 +1054,13 @@
Lf->sz_def = 1;
break;
+#if defined(HASTMPFS)
+ case TMPFSNODE:
+ Lf->sz = (SZOFFTYPE)tmp.tn_size;
+ Lf->sz_def = 1;
+ break;
+#endif /* defined(HASTMPFS) */
+
#if defined(HASEXT2FS)
case EXT2NODE:
# if defined(HASI_E2FS_PTR)
@@ -1221,6 +1263,9 @@
Lf->dev_def = Lf->rdev_def = 0;
(void) snpf(Namech, Namechl, "%#x", m.mfs_baseoff);
enter_dev_ch("memory");
+ } else if (nty == TMPFSNODE) {
+ Lf->dev_def = Lf->rdev_def = 0;
+ enter_dev_ch("memory");
}
#if defined(HASPROCFS)

View File

@@ -0,0 +1,33 @@
$NetBSD: patch-ae,v 1.11 2007/08/14 19:59:18 veego Exp $
--- dialects/n+obsd/dmnt.c.orig 2005-08-08 21:53:31.000000000 +0200
+++ dialects/n+obsd/dmnt.c 2007-08-11 14:43:05.000000000 +0200
@@ -45,6 +45,15 @@
#include <sys/statvfs.h>
#endif /* defined(NETBSDV) && defined(HASSTATVFS) */
+#if defined(NETBSDV)
+#include <sys/param.h>
+
+#if __NetBSD_Version__ >= 399002400
+#include <sys/types.h>
+#include <sys/mount.h>
+#endif
+#endif
+
#include "lsof.h"
@@ -94,7 +103,12 @@
for (; n; n--, mb++) {
if (mb->f_fstypename[0] == '\0')
continue;
+#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500
+ /* MFSNAMELEN was removed from the kernel source after 4.99.24 */
+ mb->f_fstypename[sizeof(mb->f_fstypename) - 1] = '\0';
+#else
mb->f_fstypename[MFSNAMELEN - 1] = '\0';
+#endif
/*
* Interpolate a possible symbolic directory link.
*/

View File

@@ -0,0 +1,78 @@
$NetBSD: patch-af,v 1.14 2009/05/17 20:40:46 seb Exp $
--- dialects/n+obsd/dlsof.h.orig 2006-03-28 21:54:15.000000000 +0000
+++ dialects/n+obsd/dlsof.h
@@ -95,6 +95,10 @@ struct uio; /* dummy for function protot
# endif /* (defined(OPENBSDV) && OPENBSDV<3030)
|| (defined(NETBSDV) && __NetBSD_Version__>=106060000) */
+# if defined(NETBSDV) && NETBSDV>=1003000
+#define sockproto NETBSD_sockproto
+# endif /* defined(NETBSDV) && NETBSDV>=1003000 */
+
#include <sys/mount.h>
# if (defined(OPENBSDV) && OPENBSDV>=3030) \
@@ -106,10 +110,6 @@ struct uio; /* dummy for function protot
#include <rpc/types.h>
#include <sys/protosw.h>
-# if defined(NETBSDV) && NETBSDV>=1003000
-#define sockproto NETBSD_sockproto
-# endif /* defined(NETBSDV) && NETBSDV>=1003000 */
-
#include <sys/socket.h>
# if defined(HASMSDOSFS)
@@ -161,6 +161,7 @@ struct nameidata; /* to satisfy a functi
#include <sys/socketvar.h>
#include <sys/un.h>
#include <sys/unpcb.h>
+#include <net/route.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
@@ -170,7 +171,6 @@ struct nameidata; /* to satisfy a functi
#include <netinet6/in6_pcb.h>
# endif /* defined(HASIPv6) && defined(NETBSDV) && !defined(HASINRIAIPv6) */
-#include <net/route.h>
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
#include <netinet/tcp.h>
@@ -264,6 +264,9 @@ struct sockproto {
#undef KERNEL
#include <ufs/mfs/mfsnode.h>
+# if defined(HASTMPFS)
+#include <fs/tmpfs/tmpfs.h>
+# endif /* defined(HASTMPFS) */
# if defined(HASNFSPROTO)
#include <nfs/rpcv2.h>
@@ -489,7 +492,12 @@ extern KA_T Kpa;
struct l_vfs {
KA_T addr; /* kernel address */
fsid_t fsid; /* file system ID */
+#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500
+ /* MFSNAMELEN was removed from the kernel source after 4.99.24 */
+ char type[sizeof(((struct statvfs *)NULL)->f_fstypename)]; /* type of file system */
+#else
char type[MFSNAMELEN]; /* type of file system */
+#endif
char *dir; /* mounted directory */
char *fsname; /* file system name */
struct l_vfs *next; /* forward link */
@@ -581,4 +589,12 @@ struct sfile {
# endif /* defined(HASNCVPID) */
# endif /* defined(HASNCACHE) */
+#if defined(VV_ROOT) /* NetBSD >= 4.99.33 */
+#define VNODE_VFLAG v_vflag
+#define NCACHE_VROOT VV_ROOT
+#else
+#define VNODE_VFLAG v_flag
+#define NCACHE_VROOT VROOT
+#endif /* VV_ROOT */
+
#endif /* NETBSD_LSOF_H */

View File

@@ -0,0 +1,167 @@
$NetBSD: patch-ag,v 1.7 2013/01/12 03:27:21 dholland Exp $
--- Configure.orig 2010-07-29 15:59:32.000000000 +0000
+++ Configure
@@ -105,6 +105,7 @@ LSOF_VF=version
# $LSOF_LOCALSUFFIX local suffix for Makefile
# $LSOF_NBSD_BUFQH NetBSD <sys/bufq.h> copy status
# $LSOF_NBSD_PTYFS NetBSD ${NETBSD_SYS}/sys/fs/ptyfs/ copy status
+# $LSOF_NBSD_TMPFS NetBSD ${NETBSD_SYS}/sys/fs/tmpfs/ copy status
# $LSOF_N_UNIXV *BSD system's kernel file
# $LSOF_PL patch level
# $LSOF_RANLIB randomizing command for the lsof library
@@ -2782,6 +2783,11 @@ return(0); }
# Validate the NetBSD version.
case $LSOF_VSTR in # {
+ 0*|1.[01]*)
+ LSOF_VERS="1006000"
+ echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR"
+ echo "!!!WARNING!!! Configuring for NetBSD 1.2"
+ ;;
1.2*)
LSOF_VERS="1002000"
;;
@@ -2838,10 +2844,44 @@ return(0); }
echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR"
echo "!!!WARNING!!! Configuring for NetBSD 3.0"
;;
+ 4.0*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="4000000"
+ ;;
+ 4.99.*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="4099000"
+ ;;
+ 4*)
+ LSOF_VERS="4000000"
+ echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR"
+ echo "!!!WARNING!!! Configuring for NetBSD 4.0"
+ ;;
+ 5.[012]*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="5000000"
+ ;;
+ 5.99.*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="5099000"
+ ;;
+ 5*)
+ LSOF_VERS="5000000"
+ echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR"
+ echo "!!!WARNING!!! Configuring for NetBSD 5.0"
+ ;;
+ 6.0*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="6000000"
+ ;;
+ 6.99.*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="6099000"
+ ;;
*)
+ LSOF_VERS="5000000"
echo "Unknown NetBSD release: $LSOF_VSTR"
- echo Assuming NetBSD 1.6
- LSOF_VERS="1006000"
+ echo "!!!WARNING!!! Configuring for NetBSD 5.0"
;;
esac # }
fi # }
@@ -2855,6 +2895,12 @@ return(0); }
;;
3000000|3099000)
;;
+ 4000000|4099000)
+ ;;
+ 5000000|5099000)
+ ;;
+ 6000000|6099000)
+ ;;
*)
echo "Unknown NetBSD version: $LSOF_VERS"
rm -f $LSOF_HLP
@@ -2863,7 +2909,10 @@ return(0); }
esac # }
LSOF_CFGF="$LSOF_CFGF -DNETBSDV=$LSOF_VERS"
LSOF_TMP1="-DN_UNIXV=/netbsd"
- if test -r ${LSOF_INCLUDE}/util.h # {
+ if test -r /dev/ksyms # {
+ then
+ LSOF_TMP1="-DN_UNIXV=/dev/ksyms"
+ elif test -r ${LSOF_INCLUDE}/util.h # {
then
grep -q getbootfile ${LSOF_INCLUDE}/util.h
if test $? -eq 0 # {
@@ -3262,6 +3311,7 @@ return(0); }
fi # }
LSOF_TMP2="sys/vnode.h"
LSOF_NBSD_PTYFS=0
+ LSOF_NBSD_TMPFS=0
if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # {
then
LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2"
@@ -3339,6 +3389,24 @@ return(0); }
fi # }
fi # }
fi # }
+ grep -q VT_TMPFS $LSOF_TMP3
+ if test $? -eq 0 # {
+ then
+ LSOF_TMP2="fs/tmpfs/tmpfs.h"
+ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -DHASTMPFS"
+ else
+ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # {
+ then
+ if test $NETBSD_SYS != $LSOF_INCLUDE # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -DHASTMPFS"
+ LSOF_NBSD_TMPFS=1
+ fi # }
+ fi # }
+ fi # }
+ fi # }
if test "X$NETBSD_UVM" = "X" # {
then
grep -q UVM $LSOF_TMP3
@@ -3624,6 +3692,28 @@ return(0); }
LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include"
fi # }
fi # }
+ if test $LSOF_NBSD_TMPFS -eq 1 # {
+ then
+
+ # Make a local copy of $NETBSD_SYS/sys/fs/tmpfs/tmpfs.h.
+
+ if test ! -d dialects/n+obsd/include # {
+ then
+ mkdir dialects/n+obsd/include
+ fi # }
+ if test ! -d dialects/n+obsd/include/fs # {
+ then
+ mkdir dialects/n+obsd/include/fs
+ fi # }
+ rm -rf dialects/n+obsd/include/fs/tmpfs
+ mkdir dialects/n+obsd/include/fs/tmpfs
+ cp $NETBSD_SYS/fs/tmpfs/tmpfs.h dialects/n+obsd/include/fs/tmpfs
+ echo $LSOF_CFGF | grep /dialects/n+obsd/include > /dev/null 2>&1
+ if test $? -ne 0 # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include"
+ fi # }
+ fi # }
LSOF_CFGL="$LSOF_CFGL -lkvm"
LSOF_DIALECT_DIR=n+obsd
;;
@@ -5309,7 +5399,7 @@ fi # }
echo "" >> $LSOF_MKFC
if test "X$LSOF_DEBUG" = "X" # {
then
- LSOF_DEBUG="-O"
+ LSOF_DEBUG=""
else
if test "X$LSOF_DEBUG" = "XNo-O" # {
then

View File

@@ -0,0 +1,135 @@
$NetBSD: patch-ah,v 1.5 2011/03/21 00:22:02 jym Exp $
--- dialects/n+obsd/dproc.c.orig 2005-05-11 14:54:00.000000000 +0200
+++ dialects/n+obsd/dproc.c
@@ -37,6 +37,33 @@ static char *rcsid = "$Id: dproc.c,v 1.1
#include "lsof.h"
+#if __NetBSD_Version__ >= 499006200
+ /*
+ * In NetBSD-4.99.62, struct fdfile was added, struct filedesc::fd_ofiles
+ * changed type from struct file ** to struct fdfile **, and
+ * fd_ofileflags disappeared from struct filedesc, being
+ * replaced by fields in struct fdfile.
+ */
+# define HAVE_STRUCT_FDFILE 1
+# define FILESTRUCT struct fdfile
+#else
+# undef HAVE_STRUCT_FDFILE
+# define FILESTRUCT struct file
+#endif
+#if __NetBSD_Version__ >= 599001400
+ /*
+ * Between NetBSD-5.99.13 and 5.99.14, struct fdtab was added, and
+ * struct filedesc::fd_ofiles and fd_nfiles were replaced by
+ * struct filedesc::fd_dt (a pointer to struct fdtab).
+ */
+# define HAVE_STRUCT_FDTAB 1
+# define NFILES(fd,dt) ((dt).dt_nfiles)
+# define OFILES(fd,dt) ((fd).fd_dt->dt_ff)
+#else
+# undef HAVE_STRUCT_FDTAB
+# define NFILES(fd,dt) ((fd).fd_nfiles)
+# define OFILES(fd,dt) ((fd).fd_ofiles)
+#endif
_PROTOTYPE(static void enter_vn_text,(KA_T va, int *n));
_PROTOTYPE(static void get_kernel_access,(void));
@@ -152,7 +179,7 @@ gather_proc_info()
struct filedesc fd;
int i, nf;
MALLOC_S nb;
- static struct file **ofb = NULL;
+ static FILESTRUCT **ofb = NULL;
static int ofbb = 0;
short pss, sf;
int px;
@@ -179,6 +206,10 @@ gather_proc_info()
struct kinfo_proc *p;
#endif /* defined(HASKVMGETPROC2) */
+#if HAVE_STRUCT_FDTAB
+ struct fdtab dt;
+#endif /* HAVE_STRUCT_FDTAB */
+
/*
* Read the process table.
*/
@@ -218,7 +249,14 @@ gather_proc_info()
if (!p->P_FD
|| kread((KA_T)p->P_FD, (char *)&fd, sizeof(fd)))
continue;
- if (!fd.fd_refcnt || fd.fd_lastfile > fd.fd_nfiles)
+ if (!fd.fd_refcnt)
+ continue;
+#if HAVE_STRUCT_FDTAB
+ if (!fd.fd_dt
+ || kread((KA_T)fd.fd_dt, (char *)&dt, sizeof(dt)))
+ continue;
+#endif /* ! HAVE_STRUCT_FDTAB */
+ if (fd.fd_lastfile > NFILES(fd,dt))
continue;
#if defined(HASCWDINFO)
@@ -278,14 +316,14 @@ gather_proc_info()
/*
* Read open file structure pointers.
*/
- if (!fd.fd_ofiles || (nf = fd.fd_nfiles) <= 0)
+ if (!OFILES(fd,dt) || (nf = NFILES(fd,dt)) <= 0)
continue;
- nb = (MALLOC_S)(sizeof(struct file *) * nf);
+ nb = (MALLOC_S)(sizeof(FILESTRUCT *) * nf);
if (nb > ofbb) {
if (!ofb)
- ofb = (struct file **)malloc(nb);
+ ofb = (FILESTRUCT **)malloc(nb);
else
- ofb = (struct file **)realloc((MALLOC_P *)ofb, nb);
+ ofb = (FILESTRUCT **)realloc((MALLOC_P *)ofb, nb);
if (!ofb) {
(void) fprintf(stderr, "%s: PID %d, no file * space\n",
Pn, p->P_PID);
@@ -293,7 +331,7 @@ gather_proc_info()
}
ofbb = nb;
}
- if (kread((KA_T)fd.fd_ofiles, (char *)ofb, nb))
+ if (kread((KA_T)OFILES(fd,dt), (char *)ofb, nb))
continue;
#if defined(HASFSTRUCT)
@@ -311,8 +349,10 @@ gather_proc_info()
}
pofb = nb;
}
+#if ! HAVE_STRUCT_FDFILE
if (!fd.fd_ofileflags || kread((KA_T)fd.fd_ofileflags, pof, nb))
zeromem(pof, nb);
+#endif /* ! HAVE_STRUCT_FDFILE */
}
#endif /* defined(HASFSTRUCT) */
@@ -321,8 +361,20 @@ gather_proc_info()
*/
for (i = 0; i < nf; i++) {
if (ofb[i]) {
+#if HAVE_STRUCT_FDFILE
+ struct fdfile fdf;
+ if (kread((KA_T)ofb[i], (char *)&fdf, sizeof(fdf)))
+ continue;
+ Cfp = fdf.ff_file;
+ if (Cfp == NULL)
+ continue;
+ if (pof)
+ pof[i] = fdf.ff_exclose;
+#else /* ! HAVE_STRUCT_FDFILE */
+ Cfp = ofb[i];
+#endif /* ! HAVE_STRUCT_FDFILE */
alloc_lfile(NULL, i);
- process_file((KA_T)(Cfp = ofb[i]));
+ process_file((KA_T)Cfp);
if (Lf->sf) {
#if defined(HASFSTRUCT)

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-dialects_n+obsd_dnode1.c,v 1.1 2013/04/20 21:48:48 dholland Exp $
Remove some additional conflicting symbols that fail the build on
NetBSD 5.1.
--- dialects/n+obsd/dnode1.c~ 2005-08-08 19:53:33.000000000 +0000
+++ dialects/n+obsd/dnode1.c
@@ -54,6 +54,9 @@ static char *rcsid = "$Id: dnode1.c,v 1.
#undef IN_LOCKED
#undef i_size
#undef IN_WANTED
+#undef i_endoff
+#undef i_diroff
+#undef i_offset
/*