[LinuxPPS] Confused about timex.h

clemens at dwf.com clemens at dwf.com
Fri Aug 29 07:55:31 CEST 2008


OK, Im confused.
This all has to do with the interaction of linuxPPS and ntp.
Now mabe its just late, and Ill understand this in the AM, but I doubt it.

The problem is with timex.h, and if we should even be worried about it.

FIRST, the kernel source has a file
	<kernel>/include/linux/timex.h

There have been some comments that if you want NANO to work you
have to update the userland version of this file to the one in the kernel.

BUT, in userland there are TWO files:
	/usr/include/sys/timex.h
and        /usr/include/linux/timex.h>

If you do the obvious thing and copy
	<kernel>/include/linux/timex.h -> /usr/include/linux/timex.h

ntp WONT see the change, since it in fact looks at /usr/include/sys/timex.h

Why there are two timex.h files in userland I have no idea.
They seem to have more more or less the same info in them.

However, If you try copying the kernel file to BOTH, ntpd will compile,
but at least one of the subsidary programs wont (it includes both).

So, lets back up one step, and ask why we were looking at timex.h in the
first place.  Well, there are some #ifdefs in the ntpd code that depend
on STA_NANO, and the thought was that using this updated include file
(not updated by linuxPPS, but rather by the kernel-nanotime-people)
this stuff would compile.

BUT, all of the STA_NANO stuff seems to be within a #ifdef of KERNEL_PLL,
which gets turned off by the configure when working with Linux, since other
structures are not there.  

So, basically, it looks like playing with timex.h is a waste of time.
The kernel would have to have the PLL and the calls to support it, to get
this NANO stuff to compile and work.

So, am I correct, or is it just too late to allow me in front of a keyboard?
-- 
                                        Reg.Clemens
                                        reg at dwf.com





More information about the LinuxPPS mailing list