Problem Description: When making a ioctl(fd, EVIOCSFF) call from 32-bit program running on 64-bit arch I'm always receiving EINVAL. Further investigation lead to the cause: Definition of the EVIOCSFF uses sizeof(struct ff_effect) which differs between 32-bit and 64-bit. 64-bit kernel does not recognize EVIOCSFF thus returning EINVAL. Steps to reproduce: A simple test program: #include <linux/input.h> #include <stdio.h> int main(int argc, char * argv[]) { printf("sizeof(struct ff_effect) = %d EVIOCSFF=%#x\n", sizeof(struct ff_effect), EVIOCSFF); return 0; } $ gcc test_size.c -o test_size && ./test_size sizeof(struct ff_effect) = 48 EVIOCSFF=0x40304580 $ gcc -m32 test_size.c -o test_size32 && ./test_size32 sizeof(struct ff_effect) = 44 EVIOCSFF=0x402c4580
Please try 2.6.27-rc3 or apply this commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2278f31d6feb9036eaa79f2e8abcce850420abd
The above patch does fix the problem for me. Thank you.