foft
Certified Guru
I'm trying to detect keyboard/joysticks being attached. I've tried several strategies, all of which work on my other linux boxes (2.6...), but none work on the GP2X! What is the best method for this?
I tried:
i) F_NOTIFY in fcntl on "/dev/input". Works and returns success, but never notifies.
ii) Checking st.st_mtime on "/dev/input". Always 0.
iii) Checking st.st_size on "/dev/input". Always 0.
iv) Checking st_mine/st_size on "/proc/bus/input/devices". Does not exist in this kernel.
v) Checking st_mine/st_size on "/proc/bus/usb/devices". Does not exist in this kernel.
vi) Opening "/dev/input" and using fseek(f,0,SEEK_END). ftell always returns 0.
vii) Opening "/dev/input" and using lseek(f,0,SEEK_END). ftell always returns 0.
viii) Opening "/dev/input" and using lseek(f,A_LARGE_NUMBER,SEEK_SET). ftell always returns the large number - even if past end.
ix) Polling /dev/input/eventx a few times a second. Too slow. Takes a second to do 100 polls?
x) Looked into telldir/seekdir. No way to seek to end?
xi) Checked /sys - does not exist.
This is getting annoying now... I'm even tempted to monitor the kernel ringbuffer (as returned by dmesg)!
Also has anyone got crosstool or crosstool NG to work with a recent gcc? I'd really like to build gcc 4.2.3 on my mac (using linux for now), but not having any luck.
Thanks,
Mark
I tried:
i) F_NOTIFY in fcntl on "/dev/input". Works and returns success, but never notifies.
ii) Checking st.st_mtime on "/dev/input". Always 0.
iii) Checking st.st_size on "/dev/input". Always 0.
iv) Checking st_mine/st_size on "/proc/bus/input/devices". Does not exist in this kernel.
v) Checking st_mine/st_size on "/proc/bus/usb/devices". Does not exist in this kernel.
vi) Opening "/dev/input" and using fseek(f,0,SEEK_END). ftell always returns 0.
vii) Opening "/dev/input" and using lseek(f,0,SEEK_END). ftell always returns 0.
viii) Opening "/dev/input" and using lseek(f,A_LARGE_NUMBER,SEEK_SET). ftell always returns the large number - even if past end.
ix) Polling /dev/input/eventx a few times a second. Too slow. Takes a second to do 100 polls?
x) Looked into telldir/seekdir. No way to seek to end?
xi) Checked /sys - does not exist.
This is getting annoying now... I'm even tempted to monitor the kernel ringbuffer (as returned by dmesg)!
Also has anyone got crosstool or crosstool NG to work with a recent gcc? I'd really like to build gcc 4.2.3 on my mac (using linux for now), but not having any luck.
Thanks,
Mark