[LinuxPPS] Confused about timex.h

Hal V. Engel hvengel at astound.net
Wed Sep 17 21:39:43 CEST 2008


On Thursday 28 August 2008 10:55:31 pm clemens at dwf.com wrote:
> 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

I did some checking and on my system this file and it's friends are installed 
as part of glibc.  I rebuilt glibc to see if it was using the 
/usr/include/linux/timex.h to derive the /usr/include/sys/timex.h files and 
found that version 2.6.1 (the version I had installed) did not so I tried 
version 2.8_p20080602 which is the latest available for my distro??  So this 
appears to be an issue with the glibc headers being out of sync with the linux 
kernel and the build not taking this into account.

I asked about this on the glibc irc channel and got no reply so it appears 
that this is something that no one there knows anything about.  I was goping 
to try opening a bug report but when I registered for the glibc bugzilla I 
never got a registration confirmation email.  So I can't even report this bug 
to upstream.  Perhaps there is someone here who has access to the glibc 
bugzilla that can report this problem?

>
> 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?




More information about the LinuxPPS mailing list