[linux-dvb] S2API: Problem with 64/32bit compatibility

Pavel Troller patrol at sinus.cz
Sun Jan 11 10:37:03 CET 2009

  I would like to report a problem with S2API. It looks that it doesn't
maintain 64/32bit compatibility.
  It began with my attempt to run the SVN version of kaffeine on linux-2.6.28.
  My system is a 64bit GNU/Linux, but, for historical reasons, I'm still using
32bit KDE 3.5.10, so kaffeine has been compiled as a 32bit binary.
  I've found that I cannot play DVB on this combination. It's because the
FE_SET_PROPERTY ioctl is not properly handled in the kernel.
  After a lot of analysis of both kaffeine and kernel source code, I've found
that the core of the problem is in /usr/src/linux/include/linux/dvb/frontend.h,
where the ioctl is declared. There, a struct dtv_properties is declared:

struct dtv_properties {
        __u32 num;
        struct dtv_property *props;

  This struct is then used as a data entry in the FE_SET_PROPERTY ioctl.
  The problem is, that the pointer has different sizes on 32 and 64bit
architectures, so the whole struct differs in size too. And because the size
is passed as a part of the ioctl command code, the FE_SET_PROPERTY (and
FE_GET_PROPERTY too) command codes differ for 32/64 bit compilation of the
same include file! For example, for FE_SET_PROPERTY, its 0x40106f52 on 64bit,
but 0x40086f52 on 32bit. So, the kernel (having the 64bit code inside) cannot
recognize the 32bit code of the cmd and fails to handle it correctly.
  The second part is that these ioctls are not yet added to the 
/usr/src/linux/fs/compat_ioctl.c file, maybe just because of the problem above.

  Are there plans to fix this problem ? I think that 64/32bit compatibility
should be fully maintained, I think that my case is not so rare yet.

  With regards, Pavel Troller   

More information about the linux-dvb mailing list