summaryrefslogtreecommitdiffstats
path: root/usr.sbin/apm
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-07-20 15:31:23 +0000
committergreen <green@FreeBSD.org>1999-07-20 15:31:23 +0000
commit291fbe9036af6d2f9c61e0a870e15daadf2970b1 (patch)
tree9eb60c8a5d6d4bbc33fbf5f27209c75bdfcd70c7 /usr.sbin/apm
parentbdf2e7cb620384d2fbee789df8f6cbf712b2f623 (diff)
downloadFreeBSD-src-291fbe9036af6d2f9c61e0a870e15daadf2970b1.zip
FreeBSD-src-291fbe9036af6d2f9c61e0a870e15daadf2970b1.tar.gz
Make wall_cmos do something.
PR: 12614
Diffstat (limited to 'usr.sbin/apm')
-rw-r--r--usr.sbin/apm/apm.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/apm/apm.c b/usr.sbin/apm/apm.c
index bf6184f..8ad45ac 100644
--- a/usr.sbin/apm/apm.c
+++ b/usr.sbin/apm/apm.c
@@ -15,18 +15,24 @@
#ifndef lint
static const char rcsid[] =
- "$Id: apm.c,v 1.13 1998/02/20 07:17:46 hosokawa Exp $";
+ "$Id: apm.c,v 1.14 1998/09/04 16:08:54 imp Exp $";
#endif /* not lint */
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <machine/apm_bios.h>
+
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/ioctl.h>
-#include <unistd.h>
-#include <machine/apm_bios.h>
#include <time.h>
+#include <unistd.h>
#define APMDEV "/dev/apm"
@@ -288,8 +294,11 @@ main(int argc, char *argv[])
int display = 0, batt_life = 0, ac_status = 0, standby = 0;
int batt_time = 0, delta = 0;
char *cmdname;
+ size_t cmos_wall_len = sizeof(cmos_wall);
-
+ if (sysctlbyname("machdep.wall_cmos_clock", &cmos_wall, &cmos_wall_len,
+ NULL, 0) == -1)
+ err(1, "sysctlbyname(machdep.wall_cmos_clock)");
if ((cmdname = strrchr(argv[0], '/')) != NULL)
cmdname++;
else
OpenPOWER on IntegriCloud