[LinuxPPS] linuxpps-v5.3.2 is missing ioctl32 compatibility

Rodolfo Giometti giometti at enneenne.com
Mon Oct 27 09:30:35 CET 2008


On Sun, Oct 26, 2008 at 05:56:19PM -0400, George Spelvin wrote:
> I thought I might mention that linuxpps is missing support for running
> 32-bit clients on a 64-bit kernel.  Since all the structures are
> fixed-size, this whould be pretty simple:

...

On Sun, Oct 26, 2008 at 07:19:28PM -0400, George Spelvin wrote:
> Okay, after rebooting with that last patch, I get
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> ioctl32(ntpd:3438): Unknown cmd fd(5) cmd(c03c70a4){t:'p';sz:60} arg(ff8328d0) on /dev/pps0
> 
> The problem here is that struct pps_fdata is 64 bytes on a 64-bit machine,
> but 60 bytes on a 32-bit one.  The extra 4 bytes are due to the fact
> that the 32-bit x86 ABI only requires 32-bit alignment for 64-bit values,
> so there is no padding at the end of struct pps_kinfo.
> 
> Style question: is it better to add
> int _padding;
> or 
> __attribute__ ((aligned (8)))
> to the struct pps_kinfo declaration?

I don't know... just take a look into kernel code. :)

In the end, can you please provide a proper patch?

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti at enneenne.com
Linux Device Driver                          giometti at linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti



More information about the LinuxPPS mailing list