On 2008/09/22 02:36, Stuart Henderson wrote: seems to work on sparc64, amd64, arm. any i386 testers around?
> Index: Makefile > =================================================================== > RCS file: /cvs/ports/net/net-snmp/Makefile,v > retrieving revision 1.31 > diff -u -p -r1.31 Makefile > --- Makefile 20 Sep 2008 22:15:51 -0000 1.31 > +++ Makefile 22 Sep 2008 01:21:44 -0000 > @@ -5,8 +5,8 @@ COMMENT-perl= SNMP modules for Perl > > V= 5.4.2 > DISTNAME= net-snmp-${V} > -PKGNAME-main= ${DISTNAME} > -PKGNAME-perl= p5-SNMP-${V} > +PKGNAME-main= ${DISTNAME}p0 > +PKGNAME-perl= p5-SNMP-${V}p0 > SHARED_LIBS= netsnmp 8.0 \ > netsnmpagent 8.0 \ > netsnmphelpers 8.0 \ > @@ -41,8 +41,6 @@ CONFIGURE_ARGS= ${CONFIGURE_SHARED} --wi > --with-sys-contact="[EMAIL PROTECTED]" \ > --with-sys-location="somewhere" \ > --with-logfile="/var/log/snmpd" \ > - --without-kmem-usage \ > - --with-out-mib-modules=host/hr_swrun \ > --with-persistent-directory="/var/net-snmp" > REGRESS_TARGET= test > > Index: patches/patch-agent_mibgroup_hardware_cpu_cpu_sysctl_c > =================================================================== > RCS file: patches/patch-agent_mibgroup_hardware_cpu_cpu_sysctl_c > diff -N patches/patch-agent_mibgroup_hardware_cpu_cpu_sysctl_c > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-agent_mibgroup_hardware_cpu_cpu_sysctl_c 22 Sep 2008 > 01:21:44 -0000 > @@ -0,0 +1,42 @@ > +$OpenBSD$ > + > +the last chunk is probably not used yet, but what they have now > +is plain wrong, so it may as well go in here so it's not lost. > + > +--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig Mon Sep 22 00:58:02 2008 > ++++ agent/mibgroup/hardware/cpu/cpu_sysctl.c Mon Sep 22 01:06:11 2008 > +@@ -37,19 +37,20 @@ void _cpu_copy_stats( netsnmp_cpu_info *cpu ); > + * (including descriptions) > + */ > + void init_cpu_sysctl( void ) { > +- int i, n; > ++ int n; > + int ncpu_mib[] = { CTL_HW, HW_NCPU }; > + int model_mib[] = { CTL_HW, HW_MODEL }; > ++ size_t i; > + char descr[ SNMP_MAXBUF ]; > + netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 ); > + strcpy(cpu->name, "Overall CPU statistics"); > + > + i = sizeof(n); > +- sysctl(ncpu_mib, 2, &n, (void *)&i, NULL, 0); > ++ sysctl(ncpu_mib, 2, &n, &i, NULL, 0); > + if ( n <= 0 ) > + n = 1; /* Single CPU system */ > + i = sizeof(descr); > +- sysctl(model_mib, 2, descr, (void *)&i, NULL, 0); > ++ sysctl(model_mib, 2, descr, &i, NULL, 0); > + for ( i = 0; i < n; i++ ) { > + cpu = netsnmp_cpu_get_byIdx( i, 1 ); > + cpu->status = 2; /* running */ > +@@ -190,8 +191,8 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void > + > + #ifdef NETSNMP_KERN_MCPU > + mcpu_stats = malloc(cpu_num*sizeof(NETSNMP_KERN_MCPU_TYPE)); > +- sysctl(mcpu_mib, 2, mcpu_stats, > +- cpu_num*sizeof(NETSNMP_KERN_MCPU_TYPE), NULL, 0); > ++ mcpu_size = sizeof(mcpu_stats); > ++ sysctl(mcpu_mib, 2, mcpu_stats, &mcpu_size, NULL, 0); > + for ( i = 0; i < cpu_num; i++ ) { > + cpu = netsnmp_cpu_get_byIdx( i, 0 ); > + /* XXX - per-CPU statistics - mcpu_mib[i].??? */ >