[LinuxPPS] [RFC] PPS: Implementing LinuxPPS API with new syscalls

clemens at dwf.com clemens at dwf.com
Fri Jun 8 08:59:09 CEST 2007


OK, except for the fact that the previous implementation of the PPSAPI
used IOCTLs rather than syscalls, these externals are looking more and
more like the previous implementation.  You REALLY SHOULD look at
what was done there, so you dont miss some of the subtle points.

For instance:

   static int time_pps_create(int source, pps_handle_t *handle)
   {
           /* In LinuxPPS there are no differences between a PPS source and
            * a PPS handle so we return the same value. */
           *handle = source;
    
           return 0;
   }   

since the user may be passing source in the variable 'i' which 
gets reused.  Rather you must malloc handle and place source in
it so that it will be long lived.

In that case destroy DOES have something to do, release the space
(be it only one word).

There are other tests that the previous code does that should be done
here.  And in fact, there is no reason to invent new code just to invent
it.  Other than changing the ioctl to syscalls (or just USING ioctl's)
would maintain the current timepps.h, with your additions.

And am I missing something, or with this new structure, shouldnt
previous code (as in ntp) just 'work' not knowing anything about
the time_pps_findsource/time_pps_findpath calls?  They would be
there if a person WANTED to use them, but would no longer be
necessary.

-- 
                                        Reg.Clemens
                                        reg at dwf.com





More information about the LinuxPPS mailing list