feed the right size to kvm_getproc2

This commit is contained in:
sthen 2010-10-26 00:42:21 +00:00
parent 8ccff15042
commit f3d1ed16b6
3 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.48 2010/10/25 22:59:12 sthen Exp $
# $OpenBSD: Makefile,v 1.49 2010/10/26 00:42:21 sthen Exp $
# XXX note there are various "openbsd[234]" ifdefs which will need adjusting when
# OpenBSD goes to 5.x
@ -10,6 +10,7 @@ COMMENT-tkmib= graphical SNMP MIB browser
V= 5.6
DISTNAME= net-snmp-$V
PKGNAME-main= ${DISTNAME}
REVISION-main= 0
PKGNAME-perl= p5-SNMP-$V
PKGNAME-tkmib= net-snmp-tkmib-$V
SHARED_LIBS= netsnmp 9.0 \

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-agent_mibgroup_host_data_access_swrun_kinfo_c,v 1.1 2010/10/25 22:59:12 sthen Exp $
$OpenBSD: patch-agent_mibgroup_host_data_access_swrun_kinfo_c,v 1.2 2010/10/26 00:42:21 sthen Exp $
--- agent/mibgroup/host/data_access/swrun_kinfo.c.orig Mon Jun 1 17:37:18 2009
+++ agent/mibgroup/host/data_access/swrun_kinfo.c Mon Oct 25 14:54:36 2010
+++ agent/mibgroup/host/data_access/swrun_kinfo.c Tue Oct 26 02:30:05 2010
@@ -51,16 +51,28 @@
/*
* later FreeBSD kinfo_proc field names
@ -45,7 +45,7 @@ $OpenBSD: patch-agent_mibgroup_host_data_access_swrun_kinfo_c,v 1.1 2010/10/25 2
}
- proc_table = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nprocs );
+#ifdef HAVE_KVM_GETPROC2
+ proc_table = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(*proc_table), &nprocs );
+ proc_table = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &nprocs );
+#else
+ proc_table = kvm_getproc(kd, KERN_PROC_ALL, 0, &nprocs );
+#endif

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-agent_mibgroup_host_hr_swrun_c,v 1.1 2010/10/25 22:59:12 sthen Exp $
--- agent/mibgroup/host/hr_swrun.c.orig Mon Oct 25 00:15:26 2010
+++ agent/mibgroup/host/hr_swrun.c Mon Oct 25 02:26:50 2010
$OpenBSD: patch-agent_mibgroup_host_hr_swrun_c,v 1.2 2010/10/26 00:42:21 sthen Exp $
--- agent/mibgroup/host/hr_swrun.c.orig Thu Jul 29 16:58:47 2010
+++ agent/mibgroup/host/hr_swrun.c Tue Oct 26 02:31:04 2010
@@ -122,6 +122,8 @@ static int LowProcIndex;
#if defined(hpux10) || defined(hpux11)
struct pst_status *proc_table;
@ -128,7 +128,7 @@ $OpenBSD: patch-agent_mibgroup_host_hr_swrun_c,v 1.1 2010/10/25 22:59:12 sthen E
+ nproc = 0;
+ return;
+ }
+ proc_table = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof (*proc_table), &nproc);
+ proc_table = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof (struct kinfo_proc2), &nproc);
+ }
#elif HAVE_KVM_GETPROCS
{