Date: 27 September 2006 8:19:55 PM PDT
Subject: [ net-snmp-Patches-1566777 ] Patch for memory_darwin.c
Patches item #1566777, was opened at 2006-09-27 20:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: chrisj (jalbert)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for memory_darwin.c
Initial Comment:
Fixes compilation issues on Mac OS X when hardware/memory is
enabled.
--- net-snmp-5.4/agent/mibgroup/hardware/memory/
memory_darwin.c 2006-03-06 08:23:52.000000000 -0800
+++ net-snmp/agent/mibgroup/hardware/memory/memory_darwin.c
2006-09-27 18:49:13.000000000 -0700
@@ -3,7 +3,11 @@
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include <net-snmp/agent/hardware/memory.h>
+#include <dirent.h>
#include <unistd.h>
+#include <mach/mach_host.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
/*
* Retained from UCD implementation
@@ -155,10 +159,11 @@
off_t swapSize;
off_t swapUsed;
vm_statistics_data_t vm_stat;
+ int count = HOST_VM_INFO_COUNT;
sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
sysctl(pagesize_mib, 2, &pagesize, &pagesize_size, NULL, 0);
- host_statistics(mach_host_self(),HOST_VM_INFO,&vm_stat,&count);
+ host_statistics(mach_host_self(),HOST_VM_INFO,(host_info_t)
&vm_stat,&count);
pages_used = vm_stat.active_count + vm_stat.inactive_count
+ vm_stat.wire_count;
----------------------------------------------------------------------
You can respond by visiting: