[ntp:hackers] posix timestamp compatibility library for systems using right timestamp

Harlan Stenn stenn at ntp.org
Wed Feb 12 14:23:44 UTC 2014


Hi Marek,

Marek Behun writes:
> I have written a small POSIX timestamp compatibility library for
> glibc/linux systems which use right timestamp on system clock (and
> also a 'right/' timezone).

Cool.

> By executing a program with LD_PRELOAD=3D/path/to/time2posix.so
> environment variable the program can still use a 'posix/' timezone and
> display system time correctly (system calls for getting/setting system
> time are patched byt time2posix.so).
> 
> I wrote this library primarily for synchronizing time from NTP servers
> that use UTC. This way, when using for example ntpdate to synchronize
> from such a server, ntpdate doesn't have to be patched to synchronize
> to right timestamp (instead of posix).

This is interesting and I think it's a useful tool for exploring the
issues around timestamps that use different timescales.

> The library could also be used on programs that cannot use 'right/'
> timezone (for example PostgreSQL can't handle leap seconds and
> therefore won't accept a 'right/' timezone in configuration). For that
> though more system call patches need to be implemented.

There is also the issue of wanting to exchange time (NTP packets)
between systems that want to track 'right/' time in the kernel and those
that track 'posix/' time in the kernel.  And you've already seen that on
any particular system, some applications may want to use 'right/' time
and others will want to sue 'posix/' time.

> The sources can be found at https://github.com/elkablo/time2posix
> 
> I would like to know if I should continue developing this library or if
> there are other ways of synchronizing to right timestamp correctly, or
> if right timestamp and consequently right timezones aren't used at all.

I'm not using any systems that use 'right/' but that doesn't mean there
are none.

There are more timescales than 'right/' and 'posix/' that people want to
use.

Network Time Foundation has been working on this issue on its General
Timestamp API Project:

 http://nwtime.org/projects/timestamp-api/

That project is addressing the use of timestamps in a wide number of
timescales (TAI, UTC, IERS-A, and even Martian Standard Time).  If
Network Time Foundation is accepted as a mentoring organization for
Google's Summer of Code for 2014 I'm hoping there will be a GSoC project
that continues the woek on the General Timestamp API Project that we
worked on in GSoC 2013.

I'm going to be traveling for most of today, so I won't be able to do
much until I get settled in this evening.

I'd be happy to see you "advance" your work thru the General Timestamp
API Project, as there will likely be cases where having a library like
yours will be sufficient for some folks.  Please let me know if you'd
like to explore that option.
-- 
Harlan Stenn <stenn at ntp.org>
http://networktimefoundation.org - be a member!


More information about the hackers mailing list