On Thu, Jan 11, 2018 at 01:03:41PM +0000, Loy, Matthias wrote:
> The first one gets a struct timespec which contains seconds and
> nanosconds. clock_adjtime takes a timex structure that contains a
> timeval structure which holds seconds and microseconds.
> 
> When looking into the source of linuxptp, you find a clock_adjtime call
> in clockadj.c function clockadj_step that seems to treat timeval as
> containing seconds and nanoseconds.

It's confusing, but it is correct. Support for nanoseconds was added
later to the interface. The timeval (and few other fields in the timex
struct) are in nanoseconds if the STA_NANO status bit is set. It's
described in the adjtimex(2) man page for instance.

-- 
Miroslav Lichvar

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to