# define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
#endif
+static const struct hwclock_param hwclock_params[] =
+{
+ { RTC_PARAM_FEATURES, "features", N_("supported features") },
+ { RTC_PARAM_CORRECTION, "correction", N_("time correction") },
+ { RTC_PARAM_BACKUP_SWITCH_MODE, "bsm", N_("backup switch mode") },
+ { }
+};
+
+const struct hwclock_param *get_hwclock_params(void)
+{
+ return hwclock_params;
+}
+
/*
* /dev/rtc is conventionally chardev 10/135
* ia64 uses /dev/efirtc, chardev 10/136
}
#endif /* __alpha__ */
+
+
static int resolve_rtc_param_alias(const char *alias, uint64_t *value)
{
const struct hwclock_param *param = &hwclock_params[0];
struct rtc_param param = {};
if (get_param_rtc(ctl, ¶m)) {
- warnx(_("unable to read the RTC parameter 0x%llx."), param.param);
+ warnx(_("unable to read the RTC parameter 0x%jx."),
+ (uintmax_t) param.param);
return 1;
}
- printf(_("The RTC parameter 0x%llx is set to 0x%llx.\n"),
- param.param, param.uvalue);
+ printf(_("The RTC parameter 0x%jx is set to 0x%jx.\n"),
+ (uintmax_t) param.param, (uintmax_t) param.uvalue);
} else if (ctl->param_set_option) {
if (ctl->testing)
static void __attribute__((__noreturn__))
usage(void)
{
- const struct hwclock_param *param = &hwclock_params[0];
+ const struct hwclock_param *param = get_hwclock_params();
fputs(USAGE_HEADER, stdout);
printf(_(" %s [function] [option...]\n"), program_invocation_short_name);
const char *help;
};
-static struct hwclock_param hwclock_params[] = {
- { RTC_PARAM_FEATURES, "features", N_("supported features") },
- { RTC_PARAM_CORRECTION, "correction", N_("time correction") },
- { RTC_PARAM_BACKUP_SWITCH_MODE, "bsm", N_("backup switch mode") },
- { }
-};
-
+extern const struct hwclock_param *get_hwclock_params(void);
extern int get_param_rtc(const struct hwclock_control *ctl, struct rtc_param *param);
extern int set_param_rtc(const struct hwclock_control *ctl);