diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2019-08-21 20:44:10 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2019-08-21 20:44:10 +0000 |
commit | 88189cd37e490ab9c99c014fc44132efceaa8868 (patch) | |
tree | b20b7feea2832be528f34e5bcec9cbb6cdc8bf26 /sys/conf/param.c | |
parent | 5e13514aef36d7e3e10f623e4512aab59b10e521 (diff) |
sysctl(2): add kern.utc_offset: successor to the DST/TIMEZONE options(4)
The DST and TIMEZONE options(4) are incompatible with KARL, so we need
some other way to compensate for an RTC running with a known offset.
Enter kern.utc_offset, an offset in minutes East of UTC. TIMEZONE has
always been minutes West, but this is inconsistent with how everyone
else talks about timezones, hence the flip.
TIMEZONE has the advantage of being compiled into the binary. Our new
sysctl(2) has no such luck, so it needs to be set as early as possible
in boot, from sysctl.conf(5), so we can correct the kernel clock from
the RTC's local time to UTC before daemons like ntpd(8) and cron(8)
start. To encourage this, kern.utc_offset is made immutable after the
securelevel(7) is raised to 1.
Prompted by yasuoka@. Discussed with deraadt@, kettenis@, yasuoka@.
Additional testing by yasuoka@.
ok deraadt@, yasuoka@
Diffstat (limited to 'sys/conf/param.c')
-rw-r--r-- | sys/conf/param.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/conf/param.c b/sys/conf/param.c index 0fc9b496694..4d9f32841d8 100644 --- a/sys/conf/param.c +++ b/sys/conf/param.c @@ -1,4 +1,4 @@ -/* $OpenBSD: param.c,v 1.43 2019/08/02 02:17:35 cheloha Exp $ */ +/* $OpenBSD: param.c,v 1.44 2019/08/21 20:44:09 cheloha Exp $ */ /* $NetBSD: param.c,v 1.16 1996/03/12 03:08:40 mrg Exp $ */ /* @@ -83,6 +83,7 @@ int tick = 1000000 / HZ; int tick_nsec = 1000000000 / HZ; int tickadj = 240000 / (60 * HZ); /* can adjust 240ms in 60s */ struct timezone tz __attribute__ ((section(".data"))) = { TIMEZONE, DST }; +int utc_offset = 0; #define NPROCESS (30 + 16 * MAXUSERS) #define NTEXT (80 + NPROCESS / 8) /* actually the object cache */ #define NVNODE (NPROCESS * 2 + NTEXT + 100) |