Word size assumptions

Hal Murray hmurray at megapathdsl.net
Sun Sep 25 00:01:58 UTC 2016


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)


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list