freebsd-ports/net-mgmt/net-snmp-devel/files/patch-memory_freebsd2.c
Jun Kuriyama ef7f2d6bba Various fixes / improvements.
See PR for details.

PR:		ports/63759
Submitted by:	Cyrille Lefevre <cyrille.lefevre@laposte.net>
2004-03-10 13:40:41 +00:00

37 lines
1 KiB
C

--- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Sat Nov 9 15:59:53 2002
+++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Sat Feb 21 11:55:05 2004
@@ -204,6 +204,7 @@
if (kd == NULL)
kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL);
+#if !defined(freebsd5)
auto_nlist(NSWDEV_SYMBOL, (char *) &nswdev, sizeof(nswdev));
auto_nlist(DMMAX_SYMBOL, (char *) &dmmax, sizeof(dmmax));
@@ -212,6 +213,7 @@
return;
auto_nlist(SWDEVT_SYMBOL, (char *) sw, nswdev * sizeof(*sw));
+#endif
n = kvm_getswapinfo(kd, kswap, sizeof(kswap) / sizeof(kswap[0]), 0);
@@ -242,7 +244,9 @@
swapUsed *= pagesize;
swapFree *= pagesize;
+#if !defined(freebsd5)
free(sw);
+#endif
}
#endif
@@ -274,7 +278,7 @@
size_t total_size = sizeof(total);
int total_mib[] = { CTL_VM, VM_METER };
- long phys_mem;
+ u_long phys_mem;
size_t phys_mem_size = sizeof(phys_mem);
int phys_mem_mib[] = { CTL_HW, HW_USERMEM };