diff options
author | joerg <joerg@pkgsrc.org> | 2007-02-05 19:19:14 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2007-02-05 19:19:14 +0000 |
commit | 157473fecfb97f3eab0a577bd98a7f3b5d87b09f (patch) | |
tree | 5437f534e94d1aa754b34fb57e4b21a558dc7287 /net | |
parent | c39b7c9ccabe690f767e9e336f028af2c4381590 (diff) | |
download | pkgsrc-157473fecfb97f3eab0a577bd98a7f3b5d87b09f.tar.gz |
Forgotten patch in last commit.
Diffstat (limited to 'net')
-rw-r--r-- | net/net-snmp/patches/patch-du | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/net/net-snmp/patches/patch-du b/net/net-snmp/patches/patch-du new file mode 100644 index 00000000000..7e0b12080a4 --- /dev/null +++ b/net/net-snmp/patches/patch-du @@ -0,0 +1,50 @@ +$NetBSD: patch-du,v 1.1 2007/02/05 19:19:14 joerg Exp $ + +--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2007-02-05 18:25:59.000000000 +0000 ++++ agent/mibgroup/hardware/memory/memory_freebsd.c +@@ -36,6 +36,12 @@ int netsnmp_mem_arch_load( netsnmp_cache + long pagesize; + int nswap; + ++#ifdef dragonfly ++ struct vmstats vms; ++ size_t vms_size = sizeof(vms); ++ size_t vmem_size = sizeof(struct vmmeter); ++#endif ++ + struct vmmeter vmem; + struct vmtotal total; + size_t total_size = sizeof(total); +@@ -53,12 +59,18 @@ int netsnmp_mem_arch_load( netsnmp_cache + sysctl(total_mib, 2, &total, &total_size, NULL, 0); + sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0); + sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0); ++#ifdef dragonfly ++ pagesize = getpagesize(); ++ sysctlbyname("vm.vmstats", & vms, &vms_size, NULL, 0); ++ sysctlbyname("vm.vmmeter", & vmem, &vmem_size, NULL, 0); ++#else + auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem)); + #ifndef freebsd4 + pagesize = 1024; + #else + pagesize = getpagesize(); + #endif ++#endif + + /* + * ... and save this in a standard form. +@@ -124,8 +136,13 @@ int netsnmp_mem_arch_load( netsnmp_cache + } else { + if (!mem->descr) + mem->descr = strdup("Cached memory"); ++#ifdef dragonfly ++ mem->units = vms.v_page_size; ++ mem->size = vms.v_cache_count; ++#else + mem->units = vmem.v_page_size; + mem->size = vmem.v_cache_count; ++#endif + mem->free = -1; + } + |