summaryrefslogtreecommitdiff
path: root/sysutils/fam
diff options
context:
space:
mode:
authorsketch <sketch>2004-11-19 12:35:22 +0000
committersketch <sketch>2004-11-19 12:35:22 +0000
commit531c656dd3471211f8e766812cb39be0d7443185 (patch)
treefcdbc3bcdfd7f1ef95b42727410287ab744a447f /sysutils/fam
parentcb4b75c0c22ba5043ebbf487b691d631b8301524 (diff)
downloadpkgsrc-531c656dd3471211f8e766812cb39be0d7443185.tar.gz
Various fixes/cleanups to get this package compiling on Solaris:
+ Use the mnttab(4) interface instead of mntent. + C++ syntax cleanups to appease the SunPro compiler. + Use MAXPATHLEN instead of NAME_MAX which can be unimplemented on strict POSIX systems. + Use POSIX inttypes.h if BSD types are not available. + RPC includes and C++ namespace fixes. + Use dirent(3) instead of older sys/dir.h interface. + Avoid `sun' namespace collision. Patch based on the work of Robert Lillack and others, described in http://mail-index.netbsd.org/tech-pkg/2004/08/20/0005.html and tested with SunPro and gcc.
Diffstat (limited to 'sysutils/fam')
-rw-r--r--sysutils/fam/Makefile30
-rw-r--r--sysutils/fam/distinfo33
-rw-r--r--sysutils/fam/patches/patch-aa4
-rw-r--r--sysutils/fam/patches/patch-ab21
-rw-r--r--sysutils/fam/patches/patch-ad80
-rw-r--r--sysutils/fam/patches/patch-ae37
-rw-r--r--sysutils/fam/patches/patch-af153
-rw-r--r--sysutils/fam/patches/patch-ag14
-rw-r--r--sysutils/fam/patches/patch-ah11
-rw-r--r--sysutils/fam/patches/patch-al13
-rw-r--r--sysutils/fam/patches/patch-am12
-rw-r--r--sysutils/fam/patches/patch-an13
-rw-r--r--sysutils/fam/patches/patch-ao10
-rw-r--r--sysutils/fam/patches/patch-ap4
-rw-r--r--sysutils/fam/patches/patch-aq21
-rw-r--r--sysutils/fam/patches/patch-ar12
-rw-r--r--sysutils/fam/patches/patch-as24
-rw-r--r--sysutils/fam/patches/patch-at21
-rw-r--r--sysutils/fam/patches/patch-av39
-rw-r--r--sysutils/fam/patches/patch-aw16
-rw-r--r--sysutils/fam/patches/patch-ax4
-rw-r--r--sysutils/fam/patches/patch-ay16
-rw-r--r--sysutils/fam/patches/patch-az16
23 files changed, 564 insertions, 40 deletions
diff --git a/sysutils/fam/Makefile b/sysutils/fam/Makefile
index bff1fc99522..16c3a3d97c0 100644
--- a/sysutils/fam/Makefile
+++ b/sysutils/fam/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2004/10/17 20:12:06 jmmv Exp $
+# $NetBSD: Makefile,v 1.20 2004/11/19 12:35:22 sketch Exp $
#
DISTNAME= fam-2.7.0
@@ -54,6 +54,34 @@ MESSAGE_SRC= ${.CURDIR}/MESSAGE ${.CURDIR}/MESSAGE.kqueue
.include "../../mk/pthread.buildlink3.mk"
.endif
+LDFLAGS.SunOS+= -lsocket -lnsl
+
+.if ${OPSYS} == "SunOS"
+SUBST_CLASSES+= sunfix dirent
+
+SUBST_MESSAGE.sunfix= "Fixing ${OPSYS} namespace collision."
+SUBST_STAGE.sunfix= pre-configure
+SUBST_FILES.sunfix+= lib/Client.c++
+SUBST_FILES.sunfix+= src/ClientConnection.c++ src/ClientConnection.h
+SUBST_FILES.sunfix+= src/LocalClient.c++ src/LocalClient.h
+SUBST_FILES.sunfix+= src/Listener.c++
+SUBST_FILES.sunfix+= src/TCP_Client.h
+SUBST_SED.sunfix= -e 's/sun\([^_]\)/sa_un\1/g'
+
+SUBST_MESSAGE.dirent= "Fixing old sys/dir.h usage."
+SUBST_STAGE.dirent= pre-configure
+SUBST_FILES.dirent+= src/Directory.c++
+SUBST_FILES.dirent+= src/DirectoryScanner.c++ src/DirectoryScanner.h
+SUBST_SED.dirent= -e 's,sys/dir.h,dirent.h,g' -e 's/struct direct/struct dirent/g'
+
+.include "../../mk/compiler.mk"
+
+.if !empty(PKGSRC_COMPILER:Msunpro)
+BUILDLINK_TRANSFORM+= rm:-lstdc++
+.endif
+
+.endif
+
post-extract:
${CP} ${FILESDIR}/IMonKQueue.c++ ${WRKSRC}/src
${CP} ${FILESDIR}/imon-compat.h ${WRKSRC}/src
diff --git a/sysutils/fam/distinfo b/sysutils/fam/distinfo
index 8172ca11b7e..fa37af2fd0d 100644
--- a/sysutils/fam/distinfo
+++ b/sysutils/fam/distinfo
@@ -1,19 +1,30 @@
-$NetBSD: distinfo,v 1.15 2004/10/17 19:20:53 jmmv Exp $
+$NetBSD: distinfo,v 1.16 2004/11/19 12:35:22 sketch Exp $
SHA1 (fam-2.7.0.tar.gz) = 6c2316f02acf89a41c42ffc3d7fd9cf5eada83a8
Size (fam-2.7.0.tar.gz) = 301974 bytes
-SHA1 (patch-aa) = 19743b7627e72e96c13a1288d8872e85d42a6dca
-SHA1 (patch-ab) = a486fd2b7330a0942717fd2aebb0fbdeb3c87dc7
+SHA1 (patch-aa) = 97f73077cf7845cc0ac13247b0d2ee92a1d722d6
+SHA1 (patch-ab) = 0ca86059b8e4f9ba59537c6525acf35784e35743
SHA1 (patch-ac) = 676966b0372780af4ee5536276132a04dd038863
-SHA1 (patch-ad) = b8e621acd36811a76a84af82e6f2b5962973e344
-SHA1 (patch-ae) = 225a0bd5195be3d3d75edf021b27bed19d84dc15
-SHA1 (patch-af) = 57946b3837479b641bb002620ae41008f49af995
-SHA1 (patch-ag) = 978fa2a582c5f9d2c8660c0a8d933211e97ef500
-SHA1 (patch-ah) = d7763198df76d1f0783342a8961b59879e8e1241
+SHA1 (patch-ad) = 19364c8dd3f887a59f41556206c8c2d179577932
+SHA1 (patch-ae) = aa8fed958555d6870367fd202a6117ddcb5a1da9
+SHA1 (patch-af) = 5868f44d29c31533bdb012213022e814d3fc3995
+SHA1 (patch-ag) = 3300a1cd565f9edaea3c334a9e278185efbcb7a6
+SHA1 (patch-ah) = dc8ec60631b57668fcef0b296efe3e271cb7fcae
SHA1 (patch-ai) = b80aafbb3849fc8c828b6829d8975b910e4d0fd5
SHA1 (patch-aj) = 39391961fd7929d6a5fb49ecb492585cb821afaa
SHA1 (patch-ak) = 48ddfcf9b7562832402a464437ca485249d371a1
-SHA1 (patch-ao) = 64827309bf91a2018629e28fef20109dde3fbf01
-SHA1 (patch-ap) = 318e99722c78b1120d444d1421f04affc107d028
+SHA1 (patch-al) = e0b4c3ca447f42573def07e8b47209ec6e6ad016
+SHA1 (patch-am) = 12e4d17ded9ca12df9788d34c0f3e3d1ba301e9a
+SHA1 (patch-an) = 7aa54fb1f90e3b2eb767d41fd842f7f4a0561b81
+SHA1 (patch-ao) = 161160f121e9338e807bfe0c5df6cf14457fec62
+SHA1 (patch-ap) = bbb31577e0cc9ffb8ccbce75082ccddd917d7cea
+SHA1 (patch-aq) = a54ba100b779fa13b35c962ba734ee11e093cb28
+SHA1 (patch-ar) = dd88a28f4951ff110949d0d79dc6aee18fc9e065
+SHA1 (patch-as) = 52c3788e2d08b8fccbef3f57fa888b0c2ea52daf
+SHA1 (patch-at) = 209f89cefac326e6c1b99bec4622ba0d6eabe1e4
SHA1 (patch-au) = 6bd507eb448b3fd126042759a3b6f70335401c5b
-SHA1 (patch-ax) = 950e9fd9de885f653f96aebaafc2269f489e2fad
+SHA1 (patch-av) = e79813d88ec48a886688539da34150c5bd229a0a
+SHA1 (patch-aw) = 9e5de9617e6cd59644294695d0ea79427b521ba0
+SHA1 (patch-ax) = 59d31ea4735ed964ac508874c422fe5bfc8efd5e
+SHA1 (patch-ay) = 081b4bc7cf25a8e30b3680b6df7599570ea0db86
+SHA1 (patch-az) = 13901fdef8c13318d585e36820c5e0aa4c28f889
diff --git a/sysutils/fam/patches/patch-aa b/sysutils/fam/patches/patch-aa
index 665ba0b061f..56f4d35609a 100644
--- a/sysutils/fam/patches/patch-aa
+++ b/sysutils/fam/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.6 2004/04/18 17:11:08 jmmv Exp $
+$NetBSD: patch-aa,v 1.7 2004/11/19 12:35:22 sketch Exp $
--- configure.ac.orig 2003-11-26 20:47:59.000000000 +0100
+++ configure.ac
@@ -7,7 +7,7 @@ $NetBSD: patch-aa,v 1.6 2004/04/18 17:11:08 jmmv Exp $
AC_HEADER_STDC
AC_HEADER_DIRENT
-AC_CHECK_HEADERS([fcntl.h limits.h linux/imon.h netinet/in.h rpc/rpc.h rpcsvc/mount.h stddef.h stdlib.h string.h syslog.h sys/imon.h sys/param.h sys/select.h sys/statvfs.h sys/syssgi.h sys/time.h sys/types.h sys/un.h unistd.h])
-+AC_CHECK_HEADERS([fcntl.h limits.h linux/imon.h netinet/in.h rpc/rpc.h rpcsvc/mount.h stddef.h stdlib.h string.h syslog.h sys/imon.h sys/param.h sys/select.h sys/statvfs.h sys/syssgi.h sys/time.h sys/types.h sys/un.h unistd.h mntent.h sys/sysmacros.h])
++AC_CHECK_HEADERS([fcntl.h limits.h linux/imon.h netinet/in.h rpc/rpc.h rpcsvc/mount.h stddef.h stdlib.h string.h syslog.h sys/imon.h sys/param.h sys/select.h sys/statvfs.h sys/syssgi.h sys/time.h sys/types.h sys/un.h unistd.h mntent.h sys/mnttab.h sys/sysmacros.h])
if test "$have_sys_imon_h"; then
MONITOR_FUNCS=IMonIRIX
diff --git a/sysutils/fam/patches/patch-ab b/sysutils/fam/patches/patch-ab
index 4eec6e8cf34..6cb88ddcc16 100644
--- a/sysutils/fam/patches/patch-ab
+++ b/sysutils/fam/patches/patch-ab
@@ -1,7 +1,7 @@
-$NetBSD: patch-ab,v 1.3 2004/03/28 22:00:05 minskim Exp $
+$NetBSD: patch-ab,v 1.4 2004/11/19 12:35:22 sketch Exp $
---- config.h.in.orig 2003-01-19 18:40:15.000000000 -0600
-+++ config.h.in
+--- config.h.in.orig 2003-01-20 00:40:15.000000000 +0000
++++ config.h.in 2004-11-08 14:04:04.600109000 +0000
@@ -52,6 +52,9 @@
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
@@ -22,16 +22,29 @@ $NetBSD: patch-ab,v 1.3 2004/03/28 22:00:05 minskim Exp $
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
-@@ -120,6 +126,12 @@
+@@ -120,6 +126,15 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
++/* Define to 1 if you have the <sys/mnttab.h> header file. */
++#undef HAVE_SYS_MNTTAB_H
++
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+#undef HAVE_SYS_SYSMACROS_H
+
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
+@@ -180,3 +192,9 @@
+
+ /* Define to `int' if <sys/types.h> doesn't define. */
+ #undef uid_t
++
++/* Use standard POSIX type if BSD type is not available */
++#ifndef u_int32_t
++#include <inttypes.h>
++typedef uint32_t u_int32_t;
++#endif
diff --git a/sysutils/fam/patches/patch-ad b/sysutils/fam/patches/patch-ad
index a0b062438c3..03c896ad171 100644
--- a/sysutils/fam/patches/patch-ad
+++ b/sysutils/fam/patches/patch-ad
@@ -1,7 +1,7 @@
-$NetBSD: patch-ad,v 1.4 2004/03/28 22:01:54 minskim Exp $
+$NetBSD: patch-ad,v 1.5 2004/11/19 12:35:22 sketch Exp $
---- src/NFSFileSystem.c++.orig 2003-01-18 08:18:12.000000000 -0600
-+++ src/NFSFileSystem.c++
+--- src/NFSFileSystem.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/NFSFileSystem.c++ 2004-11-08 17:31:41.663685000 +0000
@@ -24,7 +24,7 @@
#include "NFSFileSystem.h"
@@ -11,3 +11,77 @@ $NetBSD: patch-ad,v 1.4 2004/03/28 22:01:54 minskim Exp $
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+@@ -41,12 +41,20 @@
+ #define ACREGMIN 3
+ #endif
+
++#if defined(HAVE_SYS_MNTTAB_H)
++NFSFileSystem::NFSFileSystem(const mnttab& mnt)
++#else
+ NFSFileSystem::NFSFileSystem(const mntent& mnt)
++#endif
+ : FileSystem(mnt)
+ {
+ // Extract the host name from the fs name.
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ const char *fsname = mnt.mnt_special;
++#else
+ const char *fsname = mnt.mnt_fsname;
++#endif
+ const char *colon = strchr(fsname, ':');
+ if(colon == NULL)
+ {
+@@ -55,12 +63,12 @@
+ assert(colon);
+ colon = fsname;
+ }
+- char hostname[NAME_MAX + 1];
++ char hostname[MAXPATHLEN + 1];
+ int hostnamelen = colon - fsname;
+- if(hostnamelen > NAME_MAX)
++ if(hostnamelen > MAXPATHLEN)
+ {
+- assert(hostnamelen <= NAME_MAX);
+- hostnamelen = NAME_MAX;
++ assert(hostnamelen <= MAXPATHLEN);
++ hostnamelen = MAXPATHLEN;
+ }
+ strncpy(hostname, fsname, hostnamelen);
+ hostname[hostnamelen] = '\0';
+@@ -84,7 +92,11 @@
+ // acregmin, acregmax, actimeo, and noac options in the mount
+ // options. Otherwise, use defaults.
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ const char * opt = mnt.mnt_mntopts;
++#else
+ const char * opt = mnt.mnt_opts;
++#endif
+
+ bool f_noac = false;
+ bool f_actimeo = false;
+@@ -102,20 +114,20 @@
+ if (strstr(opt, "noac")) {
+ f_noac = true;
+ }
+- if ((p = strstr(opt, "actimeo")))
++ if ((p = strstr((char *)opt, "actimeo")))
+ {
+ if (sscanf(p, "actimeo=%i", &actimeo) == 1) {
+ f_actimeo = true;
+ }
+ }
+
+- if ((p = strstr(opt, "acregmin"))) {
++ if ((p = strstr((char *)opt, "acregmin"))) {
+ if (sscanf(p, "acregmin=%i", &acregmin) == 1) {
+ f_acregmin = true;
+ }
+ }
+
+- if ((p = strstr(opt, "acregmax"))) {
++ if ((p = strstr((char *)opt, "acregmax"))) {
+ if (sscanf(p, "acregmax=%i", &acregmax) == 1) {
+ f_acregmax = true;
+ }
diff --git a/sysutils/fam/patches/patch-ae b/sysutils/fam/patches/patch-ae
index 3b0d1892498..a989c32afb3 100644
--- a/sysutils/fam/patches/patch-ae
+++ b/sysutils/fam/patches/patch-ae
@@ -1,8 +1,8 @@
-$NetBSD: patch-ae,v 1.3 2004/03/28 22:00:05 minskim Exp $
+$NetBSD: patch-ae,v 1.4 2004/11/19 12:35:22 sketch Exp $
---- src/FileSystem.c++.orig 2003-01-18 08:18:12.000000000 -0600
-+++ src/FileSystem.c++
-@@ -22,7 +22,7 @@
+--- src/FileSystem.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/FileSystem.c++ 2004-11-08 15:39:34.558377000 +0000
+@@ -22,14 +22,20 @@
#include "FileSystem.h"
@@ -11,3 +11,32 @@ $NetBSD: patch-ae,v 1.3 2004/03/28 22:00:05 minskim Exp $
#include <string.h>
#include "Event.h"
+
++#if defined(HAVE_SYS_MNTTAB_H)
++FileSystem::FileSystem(const mnttab& mnt)
++ : mydir (strcpy(new char[strlen(mnt.mnt_mountp) + 1], mnt.mnt_mountp)),
++ myfsname(strcpy(new char[strlen(mnt.mnt_special) + 1], mnt.mnt_special))
++#else
+ FileSystem::FileSystem(const mntent& mnt)
+ : mydir (strcpy(new char[strlen(mnt.mnt_dir ) + 1], mnt.mnt_dir )),
+ myfsname(strcpy(new char[strlen(mnt.mnt_fsname) + 1], mnt.mnt_fsname))
++#endif
+ { }
+
+ FileSystem::~FileSystem()
+@@ -40,9 +46,15 @@
+ }
+
+ bool
++#if defined(HAVE_SYS_MNTTAB_H)
++FileSystem::matches(const mnttab& mnt) const
++{
++ return !strcmp(mydir, mnt.mnt_mountp) && !strcmp(myfsname, mnt.mnt_special);
++#else
+ FileSystem::matches(const mntent& mnt) const
+ {
+ return !strcmp(mydir, mnt.mnt_dir) && !strcmp(myfsname, mnt.mnt_fsname);
++#endif
+ }
+
+ void
diff --git a/sysutils/fam/patches/patch-af b/sysutils/fam/patches/patch-af
index c83fb561f82..f140904add4 100644
--- a/sysutils/fam/patches/patch-af
+++ b/sysutils/fam/patches/patch-af
@@ -1,7 +1,7 @@
-$NetBSD: patch-af,v 1.3 2004/03/28 22:00:05 minskim Exp $
+$NetBSD: patch-af,v 1.4 2004/11/19 12:35:22 sketch Exp $
---- src/FileSystemTable.c++.orig 2003-01-18 08:18:12.000000000 -0600
-+++ src/FileSystemTable.c++
+--- src/FileSystemTable.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/FileSystemTable.c++ 2004-11-08 17:08:21.655221000 +0000
@@ -21,11 +21,13 @@
// Temple Place - Suite 330, Boston MA 02111-1307, USA.
@@ -17,7 +17,152 @@ $NetBSD: patch-af,v 1.3 2004/03/28 22:00:05 minskim Exp $
#if HAVE_STATVFS
#include <sys/statvfs.h>
-@@ -255,7 +257,10 @@ FileSystemTable::find(const char *path,
+@@ -106,7 +108,11 @@
+
+ // Read /etc/mtab.
+ Cred::SuperUser.become_user();
++#if defined(HAVE_SYS_MNTTAB_H)
++ FILE *mtab = fopen(mtab_name, "r");
++#else
+ FILE *mtab = setmntent(mtab_name, "r");
++#endif
+ if(mtab == NULL)
+ {
+ Log::error("couldn't open %s for reading", mtab_name);
+@@ -114,40 +120,86 @@
+ return;
+ }
+ root = NULL;
++#if defined(HAVE_SYS_MNTTAB_H)
++ resetmnttab(mtab);
++ int ret = 0;
++ do
++#else
+ for (mntent *mp; ((mp = getmntent(mtab)) != NULL); )
++#endif
+ {
++#if defined(HAVE_SYS_MNTTAB_H)
++ struct mnttab ment, *mp;
++ mp = &ment;
++ ret = getmntent(mtab, mp);
++ FileSystem *fs = fs_by_name ? fs_by_name->find(mp->mnt_mountp) : NULL;
++#else
+ FileSystem *fs = fs_by_name ? fs_by_name->find(mp->mnt_dir) : NULL;
++#endif
+ if (fs && fs->matches(*mp))
+ {
+ Log::debug("mtab: MATCH \"%s\" on \"%s\" using type <%s>",
++#if defined(HAVE_SYS_MNTTAB_H)
++ mp->mnt_special, mp->mnt_mountp, mp->mnt_fstype);
++
++ new_fs_by_name->insert(mp->mnt_mountp, fs);
++ if (dismounted_fses.find(mp->mnt_mountp))
++ dismounted_fses.remove(mp->mnt_mountp);
++#else
+ mp->mnt_fsname, mp->mnt_dir, mp->mnt_type);
+
+ new_fs_by_name->insert(mp->mnt_dir, fs);
+ if (dismounted_fses.find(mp->mnt_dir))
+ dismounted_fses.remove(mp->mnt_dir);
++#endif
+ }
+ else
+ {
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ if ((!strcmp(mp->mnt_fstype, MNTTYPE_NFS)
++#else
+ if ((!strcmp(mp->mnt_type, MNTTYPE_NFS)
++#endif
+ #if HAVE_MNTTYPE_NFS2
++#if defined(HAVE_SYS_MNTTAB_H)
++ || !strcmp(mp->mnt_fstype, MNTTYPE_NFS2)
++#else
+ || !strcmp(mp->mnt_type, MNTTYPE_NFS2)
+ #endif
++#endif
+ #if HAVE_MNTTYPE_NFS3
++#if defined(HAVE_SYS_MNTTAB_H)
++ || !strcmp(mp->mnt_fstype, MNTTYPE_NFS3)
++#else
+ || !strcmp(mp->mnt_type, MNTTYPE_NFS3)
+ #endif
++#endif
+ #if HAVE_MNTTYPE_CACHEFS
++#if defined(HAVE_SYS_MNTTAB_H)
++ || !strcmp(mp->mnt_fstype, MNTTYPE_CACHEFS)
++#else
+ || !strcmp(mp->mnt_type, MNTTYPE_CACHEFS)
+ #endif
++#endif
++#if defined(HAVE_SYS_MNTTAB_H)
++ ) && strchr(mp->mnt_special, ':'))
++#else
+ ) && strchr(mp->mnt_fsname, ':'))
++#endif
+ {
+ if(Log::get_level() == Log::DEBUG)
+ {
+ const char *mntopt = hasmntopt(mp, "dev");
+ if(mntopt == NULL) mntopt = "";
+ Log::debug("mtab: new NFS \"%s\" on \"%s\" %s using <%s>",
++#if defined(HAVE_SYS_MNTTAB_H)
++ mp->mnt_special, mp->mnt_mountp, mntopt,
++ mp->mnt_fstype);
++#else
+ mp->mnt_fsname, mp->mnt_dir, mntopt,
+ mp->mnt_type);
++#endif
+ }
+
+ fs = new NFSFileSystem(*mp);
+@@ -155,24 +207,45 @@
+ else
+ {
+ Log::debug("mtab: new local \"%s\" on \"%s\"",
++#if defined(HAVE_SYS_MNTTAB_H)
++ mp->mnt_special, mp->mnt_mountp);
++#else
+ mp->mnt_fsname, mp->mnt_dir);
++#endif
+
+ fs = new LocalFileSystem(*mp);
+ }
++#if defined(HAVE_SYS_MNTTAB_H)
++ new_fs_by_name->insert(mp->mnt_mountp, fs);
++#else
+ new_fs_by_name->insert(mp->mnt_dir, fs);
++#endif
+ if (fs_by_name)
+ {
+ // Find parent filesystem.
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ FileSystem *parent = longest_prefix(mp->mnt_mountp);
++#else
+ FileSystem *parent = longest_prefix(mp->mnt_dir);
++#endif
+ assert(parent);
+ mount_parents.insert(parent->dir(), parent);
+ }
+ }
++#if defined(HAVE_SYS_MNTTAB_H)
++ if (!strcmp(mp->mnt_mountp, "/"))
++#else
+ if (!strcmp(mp->mnt_dir, "/"))
++#endif
+ root = fs;
+ }
++#if defined(HAVE_SYS_MNTTAB_H)
++ while (ret != -1);
++ fclose(mtab);
++#else
+ endmntent(mtab);
++#endif
+
+ if(root == NULL)
+ {
+@@ -255,7 +328,10 @@
// create_fs_by_name initializes our "root" member variable.
if (!fs_by_name)
{ create_fs_by_name();
diff --git a/sysutils/fam/patches/patch-ag b/sysutils/fam/patches/patch-ag
index 01224f0acb9..9e5e565f363 100644
--- a/sysutils/fam/patches/patch-ag
+++ b/sysutils/fam/patches/patch-ag
@@ -1,7 +1,7 @@
-$NetBSD: patch-ag,v 1.5 2004/10/17 19:20:53 jmmv Exp $
+$NetBSD: patch-ag,v 1.6 2004/11/19 12:35:22 sketch Exp $
---- src/IMon.c++.orig 2003-01-18 15:18:12.000000000 +0100
-+++ src/IMon.c++
+--- src/IMon.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/IMon.c++ 2004-11-08 14:00:46.523526000 +0000
@@ -25,6 +25,7 @@
#include <assert.h>
#include <errno.h>
@@ -10,7 +10,7 @@ $NetBSD: patch-ag,v 1.5 2004/10/17 19:20:53 jmmv Exp $
#if HAVE_IMON
#ifdef __sgi
-@@ -32,9 +33,13 @@
+@@ -32,15 +33,18 @@
#else
#include <linux/imon.h>
#endif
@@ -24,3 +24,9 @@ $NetBSD: patch-ag,v 1.5 2004/10/17 19:20:53 jmmv Exp $
#include <unistd.h>
#include "Interest.h"
+ #include "Log.h"
+ #include "Scheduler.h"
+-#include "alloc.h"
+
+ int IMon::imonfd = -2;
+ IMon::EventHandler IMon::ehandler = NULL;
diff --git a/sysutils/fam/patches/patch-ah b/sysutils/fam/patches/patch-ah
index f41859744b7..5784fd2fc7c 100644
--- a/sysutils/fam/patches/patch-ah
+++ b/sysutils/fam/patches/patch-ah
@@ -1,4 +1,4 @@
-$NetBSD: patch-ah,v 1.4 2004/03/28 22:00:05 minskim Exp $
+$NetBSD: patch-ah,v 1.5 2004/11/19 12:35:22 sketch Exp $
--- src/Interest.c++.orig 2003-01-18 08:18:12.000000000 -0600
+++ src/Interest.c++
@@ -12,3 +12,12 @@ $NetBSD: patch-ah,v 1.4 2004/03/28 22:00:05 minskim Exp $
#include <errno.h>
#include <string.h>
+@@ -46,7 +48,7 @@
+ #include "Pollster.h"
+ #include "timeval.h"
+
+-Interest *Interest::hashtable[];
++Interest *Interest::hashtable[HASHSIZE];
+ IMon Interest::imon(imon_handler);
+ bool Interest::xtab_verification = true;
+
diff --git a/sysutils/fam/patches/patch-al b/sysutils/fam/patches/patch-al
new file mode 100644
index 00000000000..b06badbcbbf
--- /dev/null
+++ b/sysutils/fam/patches/patch-al
@@ -0,0 +1,13 @@
+$NetBSD: patch-al,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- include/BTree.h.orig 2004-11-08 14:39:58.687960000 +0000
++++ include/BTree.h 2004-11-08 14:40:32.481144000 +0000
+@@ -76,8 +76,6 @@
+
+ static unsigned sizeofnode() { return sizeof (Node); }
+
+-private:
+-
+ enum { fanout = 32 };
+ enum Status { OK, NO, OVER, UNDER };
+
diff --git a/sysutils/fam/patches/patch-am b/sysutils/fam/patches/patch-am
new file mode 100644
index 00000000000..7f6bd60855a
--- /dev/null
+++ b/sysutils/fam/patches/patch-am
@@ -0,0 +1,12 @@
+$NetBSD: patch-am,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- lib/fam.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ lib/fam.c++ 2004-11-08 13:45:48.827971000 +0000
+@@ -22,6 +22,7 @@
+
+ #include <sys/types.h>
+ #include <rpc/rpc.h>
++#include <rpc/rpcent.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+ #include <stdlib.h>
diff --git a/sysutils/fam/patches/patch-an b/sysutils/fam/patches/patch-an
new file mode 100644
index 00000000000..bc4518101de
--- /dev/null
+++ b/sysutils/fam/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- src/Scheduler.h.orig 2004-11-08 14:42:30.148229000 +0000
++++ src/Scheduler.h 2004-11-08 14:43:04.014844000 +0000
+@@ -88,8 +88,6 @@
+ static void loop() { running = true;
+ while (running) select(); }
+
+-private:
+-
+ // Per-filedescriptor info is the set of three handlers and their
+ // closures.
+
diff --git a/sysutils/fam/patches/patch-ao b/sysutils/fam/patches/patch-ao
index 949feadc71e..670c27561ae 100644
--- a/sysutils/fam/patches/patch-ao
+++ b/sysutils/fam/patches/patch-ao
@@ -1,8 +1,8 @@
-$NetBSD: patch-ao,v 1.3 2004/03/28 22:00:05 minskim Exp $
+$NetBSD: patch-ao,v 1.4 2004/11/19 12:35:22 sketch Exp $
--- src/fam-mntent.h.orig Sun May 12 19:15:01 2002
+++ src/fam-mntent.h
-@@ -0,0 +1,56 @@
+@@ -0,0 +1,62 @@
+/*
+ * mntent
+ * fam-mntent.h - compatability header for BSD
@@ -34,6 +34,12 @@ $NetBSD: patch-ao,v 1.3 2004/03/28 22:00:05 minskim Exp $
+
+#if defined(HAVE_MNTENT_H)
+#include <mntent.h>
++#elif defined(HAVE_SYS_MNTTAB_H)
++#include <stdio.h>
++#include <unistd.h>
++#include <sys/mntent.h>
++#include <sys/mnttab.h>
++#define MOUNTED MNTTAB
+#else
+#ifndef _MNTENT_H
+#define _MNTENT_H
diff --git a/sysutils/fam/patches/patch-ap b/sysutils/fam/patches/patch-ap
index 19a2a77129c..de75a43b192 100644
--- a/sysutils/fam/patches/patch-ap
+++ b/sysutils/fam/patches/patch-ap
@@ -1,4 +1,4 @@
-$NetBSD: patch-ap,v 1.7 2004/10/16 14:40:23 jmmv Exp $
+$NetBSD: patch-ap,v 1.8 2004/11/19 12:35:22 sketch Exp $
--- src/mntent_compat.c++.orig 2004-04-30 14:24:58.000000000 +0200
+++ src/mntent_compat.c++ 2004-04-30 14:28:45.000000000 +0200
@@ -42,7 +42,7 @@ $NetBSD: patch-ap,v 1.7 2004/10/16 14:40:23 jmmv Exp $
+
+#include "config.h"
+#include "fam-mntent.h"
-+#if !defined(HAVE_MNTENT_H)
++#if !defined(HAVE_MNTENT_H) && !defined(HAVE_SYS_MNTTAB_H)
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
diff --git a/sysutils/fam/patches/patch-aq b/sysutils/fam/patches/patch-aq
new file mode 100644
index 00000000000..4d9976d59ca
--- /dev/null
+++ b/sysutils/fam/patches/patch-aq
@@ -0,0 +1,21 @@
+$NetBSD: patch-aq,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- src/ServerHost.h.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/ServerHost.h 2004-11-08 13:45:49.261211000 +0000
+@@ -24,6 +24,7 @@
+ #define ServerHost_included
+
+ #include <limits.h>
++#include <stdio.h>
+ #include "Boolean.h"
+ #include "ClientInterest.h"
+ #include "RequestMap.h"
+@@ -101,7 +102,7 @@
+ private:
+
+ Request myrequest;
+- char mypath[NAME_MAX];
++ char mypath[MAXPATHLEN];
+
+ };
+
diff --git a/sysutils/fam/patches/patch-ar b/sysutils/fam/patches/patch-ar
new file mode 100644
index 00000000000..503c1a6e7ae
--- /dev/null
+++ b/sysutils/fam/patches/patch-ar
@@ -0,0 +1,12 @@
+$NetBSD: patch-ar,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- src/NetConnection.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/NetConnection.c++ 2004-11-08 13:45:49.439816000 +0000
+@@ -29,6 +29,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
++#include <sys/filio.h>
+ #include <sys/socket.h>
+ #include <unistd.h>
+ #include <netinet/in.h>
diff --git a/sysutils/fam/patches/patch-as b/sysutils/fam/patches/patch-as
new file mode 100644
index 00000000000..9bf314217a3
--- /dev/null
+++ b/sysutils/fam/patches/patch-as
@@ -0,0 +1,24 @@
+$NetBSD: patch-as,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- src/RPC_TCP_Connector.c++.orig 2003-01-18 14:18:12.000000000 +0000
++++ src/RPC_TCP_Connector.c++ 2004-11-09 09:44:26.581058000 +0000
+@@ -22,10 +22,19 @@
+
+ #include "RPC_TCP_Connector.h"
+
++#define PORTMAP
++
+ #include <errno.h>
++#ifdef __SUNPRO_CC
++extern "C" {
++#endif
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
++#ifdef __SUNPRO_CC
++}
++#endif
+ #include <sys/ioctl.h>
++#include <sys/filio.h>
+ #include <sys/socket.h>
+ #include <unistd.h>
+ #include <string.h>
diff --git a/sysutils/fam/patches/patch-at b/sysutils/fam/patches/patch-at
new file mode 100644
index 00000000000..b5181fda59f
--- /dev/null
+++ b/sysutils/fam/patches/patch-at
@@ -0,0 +1,21 @@
+$NetBSD: patch-at,v 1.4 2004/11/19 12:35:22 sketch Exp $
+
+--- src/NetConnection.h.orig 2004-11-08 14:44:19.318981000 +0000
++++ src/NetConnection.h 2004-11-08 14:44:42.403907000 +0000
+@@ -68,6 +68,8 @@
+ void ready_for_input(bool);
+ int get_fd() const { return fd; }
+
++ enum { MAXMSGSIZE = PATH_MAX + 40 };
++
+ protected:
+
+ virtual bool input_msg(const char *data, unsigned nbytes) = 0;
+@@ -75,7 +77,6 @@
+
+ private:
+
+- enum { MAXMSGSIZE = PATH_MAX + 40 };
+ typedef u_int32_t Length;
+ typedef struct msgList_s {
+ char msg[MAXMSGSIZE+5]; // + 4 for 32-bit length, + 1 for overflow
diff --git a/sysutils/fam/patches/patch-av b/sysutils/fam/patches/patch-av
new file mode 100644
index 00000000000..2b6732f3539
--- /dev/null
+++ b/sysutils/fam/patches/patch-av
@@ -0,0 +1,39 @@
+$NetBSD: patch-av,v 1.5 2004/11/19 12:35:22 sketch Exp $
+
+--- src/FileSystem.h.orig 2004-11-08 16:45:59.904416000 +0000
++++ src/FileSystem.h 2004-11-08 16:48:24.970550000 +0000
+@@ -27,7 +27,13 @@
+ #include "Request.h"
+ #include "Set.h"
+
++#include "fam-mntent.h"
++
++#if defined(HAVE_SYS_MNTTAB_H)
++struct mnttab;
++#else
+ struct mntent;
++#endif
+ struct stat;
+
+ // FileSystem is the abstract base class for a per-filesystem object.
+@@ -91,12 +97,20 @@
+
+ typedef Set<ClientInterest *> Interests;
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ FileSystem(const mnttab&);
++#else
+ FileSystem(const mntent&);
++#endif
+ virtual ~FileSystem();
+
+ // Miscellaneous routines
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ bool matches(const mnttab& m) const;
++#else
+ bool matches(const mntent& m) const;
++#endif
+ const char *dir() const { return mydir; }
+ const char *fsname() const { return myfsname; }
+ const Interests& interests() { return myinterests; }
diff --git a/sysutils/fam/patches/patch-aw b/sysutils/fam/patches/patch-aw
new file mode 100644
index 00000000000..632ca539d8d
--- /dev/null
+++ b/sysutils/fam/patches/patch-aw
@@ -0,0 +1,16 @@
+$NetBSD: patch-aw,v 1.5 2004/11/19 12:35:22 sketch Exp $
+
+--- src/LocalFileSystem.h.orig 2004-11-08 16:53:36.684849000 +0000
++++ src/LocalFileSystem.h 2004-11-08 16:54:10.095510000 +0000
+@@ -38,7 +38,11 @@
+
+ public:
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ LocalFileSystem(const mnttab&);
++#else
+ LocalFileSystem(const mntent&);
++#endif
+
+ virtual bool dir_entries_scanned() const;
+ virtual int get_attr_cache_timeout() const;
diff --git a/sysutils/fam/patches/patch-ax b/sysutils/fam/patches/patch-ax
index c16ef8a23f2..4b9cccf3458 100644
--- a/sysutils/fam/patches/patch-ax
+++ b/sysutils/fam/patches/patch-ax
@@ -1,4 +1,4 @@
-$NetBSD: patch-ax,v 1.8 2004/04/18 17:11:08 jmmv Exp $
+$NetBSD: patch-ax,v 1.9 2004/11/19 12:35:22 sketch Exp $
--- configure.orig 2003-11-26 20:47:26.000000000 +0100
+++ configure
@@ -26,7 +26,7 @@ $NetBSD: patch-ax,v 1.8 2004/04/18 17:11:08 jmmv Exp $
-for ac_header in fcntl.h limits.h linux/imon.h netinet/in.h rpc/rpc.h rpcsvc/mount.h stddef.h stdlib.h string.h syslog.h sys/imon.h sys/param.h sys/select.h sys/statvfs.h sys/syssgi.h sys/time.h sys/types.h sys/un.h unistd.h
+
+
-+for ac_header in fcntl.h limits.h linux/imon.h netinet/in.h rpc/rpc.h rpcsvc/mount.h stddef.h stdlib.h string.h syslog.h sys/imon.h sys/param.h sys/select.h sys/statvfs.h sys/syssgi.h sys/time.h sys/types.h sys/un.h unistd.h mntent.h sys/sysmacros.h
++for ac_header in fcntl.h limits.h linux/imon.h netinet/in.h rpc/rpc.h rpcsvc/mount.h stddef.h stdlib.h string.h syslog.h sys/imon.h sys/param.h sys/select.h sys/statvfs.h sys/syssgi.h sys/time.h sys/types.h sys/un.h unistd.h mntent.h sys/mnttab.h sys/sysmacros.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
diff --git a/sysutils/fam/patches/patch-ay b/sysutils/fam/patches/patch-ay
new file mode 100644
index 00000000000..f13cafc90ef
--- /dev/null
+++ b/sysutils/fam/patches/patch-ay
@@ -0,0 +1,16 @@
+$NetBSD: patch-ay,v 1.1 2004/11/19 12:35:22 sketch Exp $
+
+--- src/NFSFileSystem.h.orig 2004-11-08 16:55:10.124688000 +0000
++++ src/NFSFileSystem.h 2004-11-08 16:55:48.362013000 +0000
+@@ -39,7 +39,11 @@
+
+ public:
+
++#if defined(HAVE_SYS_MNTTAB_H)
++ NFSFileSystem(const mnttab&);
++#else
+ NFSFileSystem(const mntent&);
++#endif
+ ~NFSFileSystem();
+
+ virtual bool dir_entries_scanned() const;
diff --git a/sysutils/fam/patches/patch-az b/sysutils/fam/patches/patch-az
new file mode 100644
index 00000000000..7ea9f74cb54
--- /dev/null
+++ b/sysutils/fam/patches/patch-az
@@ -0,0 +1,16 @@
+$NetBSD: patch-az,v 1.1 2004/11/19 12:35:22 sketch Exp $
+
+--- src/LocalFileSystem.c++.orig 2004-11-08 17:28:08.710285000 +0000
++++ src/LocalFileSystem.c++ 2004-11-08 17:28:53.492174000 +0000
+@@ -27,7 +27,11 @@
+ #include "Log.h"
+ #include "Pollster.h"
+
++#if defined(HAVE_SYS_MNTTAB_H)
++LocalFileSystem::LocalFileSystem(const mnttab& mnt)
++#else
+ LocalFileSystem::LocalFileSystem(const mntent& mnt)
++#endif
+ : FileSystem(mnt)
+ { }
+