$OpenBSD: patch-ksysguard_ksysguardd_FreeBSD_CPU_c,v 1.3 2003/04/05 14:53:38 espie Exp $
--- ksysguard/ksysguardd/FreeBSD/CPU.c.orig	Sun Mar  9 02:17:32 2003
+++ ksysguard/ksysguardd/FreeBSD/CPU.c	Sun Mar 30 17:02:39 2003
@@ -29,7 +29,9 @@
 #endif
 #include <sys/sysctl.h>
 
+#ifndef __OpenBSD__
 #include <devstat.h>
+#endif
 #include <fcntl.h>
 #include <nlist.h>
 #include <stdio.h>
@@ -73,7 +75,15 @@ exitCpuInfo(void)
 int
 updateCpuInfo(void)
 {
+#ifdef __OpenBSD__
+	int mib[2];
+	mib[0] = CTL_KERN;
+	mib[1] = KERN_CPTIME;
+	sysctl(mib, 2, &cp_time, sizeof(cp_time), NULL, 0);
+#endif
+#ifdef __FreeBSD__
         sysctlbyname("kern.cp_time", &cp_time, sizeof(cp_time), NULL, 0);
+#endif
         percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff);
 	return (0);
 }
