Big picture...

Eric S. Raymond esr at
Tue Apr 18 05:06:03 UTC 2017

Hal Murray <hmurray at>:
> Draw an upside down tree of ntpd modules with packet processing on the left 
> and OS interface on the right and data processing in the middle.  (I'm 
> handwaving.  I mean the way you would draw the picture if you were explaining 
> things rather than the actual current module structure.  I think we are 
> reasonably close.)
> The packet code uses l_fp.  The OS interfaces use timespec and time_t.  The 
> code in the middle works in time offsets using seconds in doubles and some 
> time in time_t.
> I'm not sure that is totally correct.  It seems like a good goal.  I think we 
> are close.  That was the direction I was going when I got rid of a lot of 
> time64_t a while ago and when I cleaned up the leap-second code.

It's a good direction.

> I'd like to get rid of ntp_calendar.  Nothing urgent, it just seems like we 
> should be able to use POSIX date/time calls instead.  I made some progress in 
> the recent leap-second cleanup.

The most basic requirement for ntp_calendar is that it needs to be able to
translate a pivot date to a form that lfp_stamp_to_tspec() can use.

> One rough edge is that there is no UTC version of mktime.  There is timegm, 
> but it's not POSIX.  The linux man pages says it's a GNU extension and is 
> also available on BSDs.

Yeah, if we're going to stay inside the POSIX lines that is a blocker.
		<a href="">Eric S. Raymond</a>

Please consider contributing to my Patreon page at
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.

More information about the devel mailing list