[Pkg-net-snmp-devel] Bug#557244: net-snmp: FTBFS on GNU/kFreeBSD
Petr Salinger
Petr.Salinger at seznam.cz
Fri Nov 20 18:59:46 UTC 2009
Package: net-snmp
Version: 5.4.2.1~dfsg-3
Severity: important
Tags: patch
User: debian-bsd at lists.debian.org
Usertags: kfreebsd
Hi,
the current version fails to build on GNU/kFreeBSD.
It needs to add "|| defined(__FreeBSD_kernel__)"
into agent/mibgroup/hardware/cpu/cpu_sysctl.c,
see bellow.
Thanks in advance
Petr
--- net-snmp-5.4.2.1~dfsg.orig/agent/mibgroup/hardware/cpu/cpu_sysctl.c
+++ net-snmp-5.4.2.1~dfsg/agent/mibgroup/hardware/cpu/cpu_sysctl.c
@@ -11,7 +11,7 @@
#include <unistd.h>
#include <sys/types.h>
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <sys/resource.h>
#if !defined(CPUSTATES)
#include <sys/dkstat.h>
@@ -73,7 +73,7 @@
#define NETSNMP_CPU_STATS uint64_t
#endif
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define NETSNMP_KERN_CPU 0 /* dummy value - sysctlnametomib(2) should be used */
#else
@@ -107,7 +107,7 @@
#define NETSNMP_VM_STATS_TYPE struct uvmexp
#endif /* VM_UVMEXP2 || VM_UVMEXP */
-#elif defined(__FreeBSD__) /* FreeBSD */
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* FreeBSD */
#define NETSNMP_VM_STATS VM_METER
#define NETSNMP_VM_STATS_TYPE struct vmmeter
#define NS_VM_INTR v_intr
@@ -159,7 +159,7 @@
size_t mem_size = sizeof(NETSNMP_VM_STATS_TYPE);
netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
sysctlbyname("kern.cp_time", cpu_stats, &cpu_size, NULL, 0);
#else
sysctl(cpu_mib, 2, cpu_stats, &cpu_size, NULL, 0);
More information about the Pkg-net-snmp-devel
mailing list