[LinuxPPS] cross posting [time-nuts] NTP API on Linux 2.6.26

clemens at dwf.com clemens at dwf.com
Sun Jan 11 08:49:05 CET 2009


I had problems too.
This is Fedora6 and ntp-dev-4.2.5p153
First the utils with ntptime do not build by default, Its too late this PM for 
me to understand why.
in any case, going into util and trying 'make ntptime' failed.
I had to add the following to the top of ntptime.c

#include "sys/time.h"
#include "sys/timex.h"

struct ntptimeval {
        struct timeval time;    /* current time (ro) */
        long maxerror;          /* maximum error (us) (ro) */
        long esterror;          /* estimated error (us) (ro) */
};

and then delete as appropriate all lines referencing TAI and tai.

At that point I still get a very large offset (tho its SLOWLY decreasing) and 
ntptime
reports

[reg at mythtv ~]$ ntptime
ntp_gettime() returns code 5 (ERROR)
  time cd142137.bba5e000  Sun, Jan 11 2009  0:41:43.732, (.733000),
  maximum error 16000000 us, estimated error 16000000 us
ntp_adjtime() returns code 5 (ERROR)
  modes 0x0 (),
  offset 0.000 us, frequency 0.000 ppm, interval 1 s,
  maximum error 16000000 us, estimated error 16000000 us,
  status 0x40 (UNSYNC),
  time constant 2, precision 1.000 us, tolerance 500 ppm,

so its still reporting ERROR, and recision is still 1.000.

Guess I need to go back and read the initial postings more carefully.
I assume I need either a newer or a patched glibc.
-- 
                                        Reg.Clemens
                                        reg at dwf.com





More information about the LinuxPPS mailing list