On Mon, Mar 29, 2021 at 11:16:48AM +0200, Miroslav Lichvar wrote: > There are at least two issues with handling a zero offset as a special > value. One is that zero could potentially be a valid value in distant > future.
I not losing sleep over that, but > The other is that the kernel updates the offset when a leap > second is inserted/deleted even if the original offset is zero, so > checking for zero (in the kernel or an application) works only until > the first leap second after boot. oh, I didn't think of that. I hate leap seconds. Good thing Earth is picking up the pace again! > The kernel would need to set a flag that the offset was set. Returning > an error in clock_gettime() until the offset is set sounds reasonable > to me, but I have no idea how many of the existing applications it > would break. I think it wiser to provide another way, sysfs or something else. Thanks, Richard