[LinuxPPS] Confused about timex.h

William S. Brasher billb958 at door.net
Wed Sep 17 23:56:02 CEST 2008


On Wed, 17 Sep 2008, Hal V. Engel wrote:

> 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?
> 
> 
> _______________________________________________
> LinuxPPS mailing list
> LinuxPPS at ml.enneenne.com
> http://ml.enneenne.com/cgi-bin/mailman/listinfo/linuxpps
> Wiki: http://wiki.enneenne.com/index.php/LinuxPPS_support
> 
> 


There is a patch to update the Linux NTP API:

http://sourceware.org/ml/libc-alpha/2008-03/msg00076.html


That patch has not been applied to the glibc repository, so I applied it 
to glibc-2.7 inorder to build a NANO-kernel aware glibc.  I installed that 
glibc on the box I use to test PPS and Linux 2.6. 



More information about the LinuxPPS mailing list