[parisc-linux] Pb with ioctl and 64bits

Randolph Chung Randolph Chung <randolph@tausq.org>
Mon, 10 Jun 2002 08:24:28 -0700


> I'm loosing my nerves. I'm stuck with it since two days, and I don't understand :-(
> My ioctls are running fine with 32bits kernel. I thought I've done everything fine,
> but when compiling it with 64 bits kernel it fail with:
> sys32_ioctl: Unknown cmd fd(3) cmd(80047001) arg(00000803)
> So my question is: what is the difference between 32bits and 64bits kernel about
> the ioctls ? 

as you discovered, there's some translation that is needed for 64-bit
kernels because userspace is always 32-bits. So when running a 64-bit
kernel, some ioctls need to be translated via the logic in ioctl32.c.
The situation is similar to sparc32/sparc64.

> I think that arch/parisc/kernel/ioctl32.c is used with 64bits and not with 32bits, right ?

yes.

> If yes, what I need to do more than:
> #if defined(CONFIG_DUMP) || defined(CONFIG_DUMP_MODULE)
> COMPATIBLE_IOCTL(DIOSDUMPDEV);
> COMPATIBLE_IOCTL(DIOGDUMPDEV);
> COMPATIBLE_IOCTL(DIOSDUMPLEVEL);
> COMPATIBLE_IOCTL(DIOGDUMPLEVEL);
> COMPATIBLE_IOCTL(DIOSDUMPFLAGS);
> COMPATIBLE_IOCTL(DIOGDUMPFLAGS);
> COMPATIBLE_IOCTL(DIOSDUMPCOMPRESS);
> COMPATIBLE_IOCTL(DIOGDUMPCOMPRESS);
> COMPATIBLE_IOCTL(DIOGDINDEX);
> #endif /* DUMP */

what are the ioctl definitions used by the dump driver? (the _IO{,R,W,RW}
values). From the output you pasted:

> sys32_ioctl: Unknown cmd fd(3) cmd(80047001) arg(00000803)

that ioctl seems to be _IOW('p', 1, int) (or unsigned int or so)?

randolph