in reply to Custom ioctl on Linux?
So it turns out it wasn't a perl problem at all. My weirdo device had a driver that didn't have the 32-to-64-bit thunking layer (in Linux parlance, that's the "compat_ioctl" member of the file_operations structure, which points to the thunking routine). As a result, my 32-bit perl wasn't allowed to send ioctls to the 64-bit kernel/module while my 64-bit C program was.
What's really weird about this is that some IOCTLs were apparently auto-thunked because they shared ID numbers with common system IOCTLs, which is why some IOCTLs worked anyway while others faltered. I simply added the thunking routine to the driver, recompiled, and was on my merry way in no time.
The lesson to be learned is to make sure that your perl and C code are the same bitsize before making wild accusations on PM.
Linux folk that think they're running into this should check their module's file_operations struct declaration for .compat_ioctl.
|
|---|