From 07f9d49931125465a60f66c88b9036a0b2abdafb Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 30 Jul 2009 17:13:17 -0700 Subject: [PATCH 1/3] only need nfs/rpcv2.h on darwin --- src/os/darwin/darwin_sigar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 9fcbb807..05efd3d6 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -23,7 +23,9 @@ #include #include +#ifdef DARWIN #include +#endif #include #ifdef DARWIN From 1a00826ebb5cb44629dbe64b6f18abdbb14aa0bd Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 30 Jul 2009 17:18:32 -0700 Subject: [PATCH 2/3] sigar_proc_port_get does not compile on FreeBSD 8.0 --- src/os/darwin/darwin_sigar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 05efd3d6..361dcb6c 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -3150,7 +3150,7 @@ int sigar_nfs_server_v3_get(sigar_t *sigar, return SIGAR_OK; } -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) && /*XXX*/ (__FreeBSD_version < 800000) #define _KERNEL #include From 60182c3f829e3103ae259c1dfeca7c7eb519dd84 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 30 Jul 2009 17:46:27 -0700 Subject: [PATCH 3/3] net_route_list bandaid for FreeBSD 8.0 --- src/os/darwin/darwin_sigar.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 361dcb6c..ad876cc7 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -2381,7 +2381,11 @@ int sigar_net_route_list_get(sigar_t *sigar, if (sysctl(mib, NMIB(mib), NULL, &needed, NULL, 0) < 0) { return errno; } - +#if __FreeBSD_version >= 800000 + if (needed == 0) { + return SIGAR_ENOTIMPL; /*XXX hoping this is an 8.0beta bug*/ + } +#endif buf = malloc(needed); if (sysctl(mib, NMIB(mib), buf, &needed, NULL, 0) < 0) {