ntp bug thingie, was: Re: [Linuxpps] [PATCH] Diff against 2.6.17-rc5

Udo van den Heuvel udovdh at xs4all.nl
Fri May 26 16:07:55 CEST 2006


Rodolfo Giometti wrote:

[...]

> About the sentence:
> 
> «if you do the wildcard search time_pps_findsource(-1, ...) this is
>  potentially wrong»
> 
> I agrre. In fact if you have only one PPS source in the system
> everything works well but if not you may select a wrong PPS source.
> 
> A possible solution may be trying to find a "specified" PPS source by
> checking the "name" or "path" arguments returned by the
> time_pps_findsource(). As instance:
> 
>    for (num = 0; num < 16; num++) {
>       ret = time_pps_findsource(num, path, STRING_LEN, id, STRING_LEN);
>       if (ret < 0)
>          continue;
> 
>       if (strncmp(path, "/dev/ttyS0", STRING_LEN) == 0)
>          break;
>    }
>    if (num == 16) {
>       fprintf(stderr, "no available PPS source in the system\n");
>       exit(1);
>    }
> 
> at this point you are sure that the "num" PPS source is connected with
> serial line "/dev/ttyS0". Maybe this little code can be put into
> timepps.h directly...

Let's think about this thing here before we implement things. We want to
keep things flexible.
Can't we use something like 127.127.20.*u* with a symlink in /dev/ or
similar to link 'strange' devices and/or serials as well?
We want somethign that works with whatever there is, given a driver in
e.g. ntpd.



More information about the LinuxPPS mailing list