Hi,
I've just included libv4l2 in our app. After after a short debugging session I noticed the following:
In the man page the ioctl prototype is defined as int ioctl(int d, int request, ...). To catch the EINTR case I wrote a wrapper function:
int xioctl (int fd, int request, void *arg)
But as long as the request argument is int instead of unsigned long, the request gets sign extended:
xioctl (fd, VIDIOC_TRY_FMT, &fmt) (gdb) p/x request $2 = 0xc0d05640
int v4l2_ioctl (int fd, unsigned long int request, ...); (gdb) p/x request $3 = 0xffffffffc0d05640
Maybe you should mention this "issue" in the FAQ or documentaion.
Cheers, Gregor
PS: Should I submit the sar-constraint patch to Thierry myself?