Word size assumptions
Eric S. Raymond
esr at thyrsus.com
Sun Sep 25 02:05:41 UTC 2016
Hal Murray <hmurray at megapathdsl.net>:
>
> esr at thyrsus.com said:
> >> What part of NTP needs calendar code? That seems like the sort of code
> you
> >> would be trying to rip out.
>
> > The implicit premise is that in the real world maximum clock skew of any two
> > live systems is bounded to within a fairly small amount. So when you
> > interpret an NTP timestamp that is sufficiently far away from current time,
> > you add or subtract the number of calendar cycles required to make it
> > closer. I don't understand all the details yet.
>
> That didn't ring any bells, so I decided to poke around a bit.
>
> It works after deleting
> deleted: libntp/calyearstart.c
> deleted: tests/libntp/calendar.c
> deleted: tests/libntp/calyearstart.c
> and fixing up the corresponding references:
> modified: libntp/wscript
> modified: tests/common/tests_main.c
> modified: tests/wscript
>
> Any reason I shouldn't push that fix?
>
> --------
>
> There is also libntp/ntp_calendar.c
> It's used all over the place, mostly for simple date/time conversions, I think, for example for setting up the names for log files. I expect some of it could be POSIXified. It's also tangled up with leap seconds.
>
> I didn't find the chunk of code you were referring to, but I didn't look very hard. (there was a lot of noise to sift through)
Well, if we still need ntp_calendar.c I thinmk you probably should not delete
tests/libntp/calendar.c - thats its unit test, no?
But it does look like the calyearstart code and test is not needed and can be
dropped. I wonder why it was implemented?
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
More information about the devel
mailing list