On Wed, Jan 10, 2018 at 01:23:19PM -0000, Christian Weisgerber wrote: > On 2018-01-10, Maximilian Pichler <maxim.pich...@gmail.com> wrote: > > > * At boot the software clock (the value returned by gettimeofday) is > > initialized from the hardware clock (the one with the coin-shaped > > battery). > > ... from the RTC ("real-time clock"), yes. > > > My question is: Can OpenBSD be told initialize the software from the > > hardware clock again after the system is booted? > > No. >
This does occur on occasion; for example, when running an OpenBSD vmm(4) guest, vmd(8) will notify the guest to resynch the clock from the RTC after the host resumes from suspend/hibernate (actually, "any time the host clock varies from more than 5s since it was last read by vmd(8"), but that practically means "only during suspend/hibernate resumes"). If the OP was looking for code to do this for whatever reason, it's done via vmmci(4). -ml > > (Also, is the hardware clock ever modified aside from explicit > > invocations of date(1) or similar?) > > Yes, > * when the system is properly shut down, and > * periodically every 30 minutes, to prevent the RTC from drifting > off during long uptimes. > > -- > Christian "naddy" Weisgerber na...@mips.inka.de >