$OpenBSD: patch-src_sysdeps_openbsd_c,v 1.5 2004/10/16 16:33:56 sturm Exp $
--- src/sysdeps/openbsd.c.orig	Sun Sep  5 12:57:34 2004
+++ src/sysdeps/openbsd.c	Mon Oct 11 00:11:29 2004
@@ -53,27 +53,21 @@ gkrellm_sys_main_cleanup(void)
 #include <sys/dkstat.h>
 #include <kvm.h>
 
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/sched.h>
+
 extern	kvm_t	*kvmd;
 
 void
 gkrellm_sys_cpu_read_data(void)
 	{
+	static int mib[] = { CTL_KERN, KERN_CPTIME };
 	long		cp_time[CPUSTATES];
-	static struct nlist nl[] = {
-#define N_CP_TIME	0
-		{ "_cp_time" },
-		{ "" }
-	};
+	size_t len;
 
-
-	if (kvmd == NULL)
-		return;
-	if (nl[0].n_type == 0)
-		if (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0)
-			return;
-	if (kvm_read(kvmd, nl[N_CP_TIME].n_value,
-		     (char *)&cp_time, sizeof(cp_time)) != sizeof(cp_time))
-		return;
+	len = sizeof(cp_time);
+	if (sysctl(mib, 2, cp_time, &len, NULL, 0) < 0) return;
 
 	/* Currently, SMP is not supported */
 	gkrellm_cpu_assign_data(0, cp_time[CP_USER], cp_time[CP_NICE],
