[LinuxPPS] Changing the syscalls

clemens at dwf.com clemens at dwf.com
Mon Jul 2 21:50:28 CEST 2007


> On Sun, Jul 01, 2007 at 03:20:50PM -0600, clemens at dwf.com wrote:
> 
> > I guess I dont understand what the problem is.
> > I read your note, and the linux kernel article, and still dont understand.
> > Perhaps you can explain it in greater detail.
> > Sizes are the same (arn't they) for 32/64,  and I dont see
> > where there would be any byte order problems.
> 
> The problem is that struct timespec is not portable across 32 to 64
> bits architectures.
> 
> For each structures that has inside a struct timespec I should provide
> a "replica" which inside has a struct compat_timespec good for 64 bits
> architectures.  Also for each syscall which has struct timespec as
> input parameter I should provide a "replica" as for
> sys_time_pps_fetch() and compat_sys_time_pps_fetch().
> 
> To avoid such replications I'm thinking about using fixed structure
> across 32/64 bits to exachanging data between kernel and user space
> and managing the struct timespec at userland inside timepps.h.
> 
> Hope now I explain the problem better. :)
> 

Yes it does.
since struct timespec uses time_t and long, I have to assume the problem
is with the definition of time_t.  Unfortunately, my greps of /usr/include 
were
not clever enough to ever run down the definition of time_t...

So not knowing what time_t looks like, I would agree with your solution
of using something better behaved for the transmission from user/kernel.
My initial assumption would be that a long int would be appropriate, that
should take care of times for a while... (well 100 years)...

Thanks

-- 
                                        Reg.Clemens
                                        reg at dwf.com





More information about the LinuxPPS mailing list