$OpenBSD: patch-ksysguard_ksysguardd_FreeBSD_apm_c,v 1.2 2003/01/27 19:22:50 espie Exp $
--- ksysguard/ksysguardd/FreeBSD/apm.c.orig	Sun Oct 27 00:07:11 2002
+++ ksysguard/ksysguardd/FreeBSD/apm.c	Thu Jan  9 23:22:01 2003
@@ -23,7 +23,11 @@
 
 #include <unistd.h>
 #include <fcntl.h>
+#ifdef __OpenBSD__
+#include <machine/apmvar.h>
+#else
 #include <machine/apm_bios.h>
+#endif
 #include <stdio.h>
 
 #include "Command.h"
@@ -62,6 +66,22 @@ exitApm(void)
 	close(ApmFD);
 }
 
+#ifdef __OpenBSD__
+
+int
+updateApm(void)
+{
+	struct apm_power_info info;
+	int retval;
+
+	retval = ioctl(ApmFD, APM_IOC_GETPOWER, &info);
+
+	BattFill = info.battery_life;
+	BattTime = info.minutes_left;
+
+	return retval;
+}
+#else
 int
 updateApm(void)
 {
@@ -75,6 +95,7 @@ updateApm(void)
 
 	return retval;
 }
+#endif
 
 void
 printApmBatFill(const char* c)
