[ntp:questions] Re: Jonathan Buzzard's radioclkd and FreeBSD

Jonathan Buzzard jonathan at uk.me.buzzard
Sun Nov 9 22:07:27 UTC 2003

In article <slrnbqtcvb.17ug.hjj at freesbee.wheel.dk>,
	Hans Jørgen Jakobsen <hjj at wheel.dk> writes:

> Your have a point in that timegm is non std. A closer look at the FreeBSD
> man page conformed that its non std. ANd as far as i can see its not present
> in Solaris 8 (At least not in the man pages)
> I have some trouble convincing myself that there ar no bugs lurking in the
> code above. What happens when we are changing summertime/normaltime?? 
> If timegm is not universal available the best thing could be to let
> mktime do all the conversion including summertime.

Or alternatively look at the latest source code for radioclkd. I
did a cut down version of the mktime from the ntp source code that
ignores daylight savings, and the current time zone, expects
an already normalized tm struct, and does not recompute tm_yday
and tm_wday.

While more limited than mktime and even timegm it is ideal for
what radioclock needs, i.e. a method for turning a tm struct
into time_t value without extra stuff getting in the way.


Jonathan A. Buzzard                 Email: jonathan (at) buzzard.me.uk
Northumberland, United Kingdom.       Tel: +44 1661-832195

More information about the questions mailing list