]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/hwclock.h
build-sys: move hwclock to sys-utils/
[thirdparty/util-linux.git] / sys-utils / hwclock.h
1 #ifndef HWCLOCK_CLOCK_H
2 #define HWCLOCK_CLOCK_H
3
4 #include <errno.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <time.h>
9
10 #include "c.h"
11
12 struct clock_ops {
13 char *interface_name;
14 int (*get_permissions) (void);
15 int (*read_hardware_clock) (struct tm * tm);
16 int (*set_hardware_clock) (const struct tm * tm);
17 int (*synchronize_to_clock_tick) (void);
18 };
19
20 extern struct clock_ops *probe_for_cmos_clock(void);
21 extern struct clock_ops *probe_for_rtc_clock(void);
22 extern struct clock_ops *probe_for_kd_clock(void);
23
24 typedef int bool;
25
26 /* hwclock.c */
27 extern char *progname;
28 extern int debug;
29 extern unsigned long epoch_option;
30 extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
31 /* cmos.c */
32 extern void set_cmos_epoch(int ARCconsole, int SRM);
33 extern void set_cmos_access(int Jensen, int funky_toy);
34
35 /* rtc.c */
36 extern int get_epoch_rtc(unsigned long *epoch, int silent);
37 extern int set_epoch_rtc(unsigned long epoch);
38 extern char *rtc_dev_name;
39
40 #ifdef HAVE_LIBAUDIT
41 extern void hwaudit_exit(int status);
42 # define hwclock_exit(_status) hwaudit_exit(_status)
43 #else
44 # define hwclock_exit(_status) exit(_status)
45 #endif
46
47 #endif /* HWCLOCK_CLOCK_H */