aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/auxstats
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2005-11-07 04:47:35 +0000
committerwkj <devnull@localhost>2005-11-07 04:47:35 +0000
commit6f6012e1e9723792395c6f8a96a3fa261ef91c56 (patch)
treefdff71596fed96c8f4419ce801c2e4bc6c542d3e /src/cmd/auxstats
parent7444e9d14f1443aef9230e891661327e0c468197 (diff)
downloadplan9port-6f6012e1e9723792395c6f8a96a3fa261ef91c56.tar.gz
plan9port-6f6012e1e9723792395c6f8a96a3fa261ef91c56.tar.bz2
plan9port-6f6012e1e9723792395c6f8a96a3fa261ef91c56.zip
Fix the build on FreeBSD 6.x.
The resulting binary still seems to produce suspect statistics.
Diffstat (limited to 'src/cmd/auxstats')
-rw-r--r--src/cmd/auxstats/FreeBSD.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/cmd/auxstats/FreeBSD.c b/src/cmd/auxstats/FreeBSD.c
index 2d0fd57e..737fe390 100644
--- a/src/cmd/auxstats/FreeBSD.c
+++ b/src/cmd/auxstats/FreeBSD.c
@@ -11,7 +11,9 @@
#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_types.h>
+#if __FreeBSD_version < 600000
#include <machine/apm_bios.h>
+#endif
#include <sys/ioctl.h>
#include <limits.h>
#include <libc.h>
@@ -137,7 +139,8 @@ int
xacpi(int first)
{
int rv;
- int val, len;
+ int val;
+ long len;
len = sizeof(val);
rv = sysctlbyname("hw.acpi.battery.life", &val, &len, nil, 0);
@@ -154,6 +157,7 @@ xacpi(int first)
}
#endif
+#if __FreeBSD_version < 600000
void
xapm(int first)
{
@@ -175,6 +179,13 @@ xapm(int first)
if(ai.ai_batt_life <= 100)
Bprint(&bout, "battery =%d 100\n", ai.ai_batt_life);
}
+#else
+void
+xapm(int first)
+{
+ return;
+}
+#endif
int
rsys(char *name, char *buf, int len)