Non-blocking I/O on bulk endpoints
rab at mall.freebsdmall.com
Sun Jan 22 07:02:37 PST 2006
If I open a USB endpoint with the O_NONBLOCK bit set, it works
okay if it is an "interrupt" endpoint, and will return EWOULDBLOCK
for a read() if there is no data. But if it is a "bulk" endpoint,
the read() will block. So I tried using select() to find out if
there was data available before trying to read it. But select()
seems to work properly only for "interrupt" endpoints. On a
"bulk" endpoint, select() always reports that there is data ready
to be read, even when there is not.
Is there any way to do non-blocking I/O on a bulk endpoint?
I looked at sys/dev/usb/ugen.c, and it looks like non-blocking
I/O is intentionally left out for bulk endpoints. So maybe
there is something that makes it difficult to implement.
I am running FreeBSD 6.0, on an AMD64, if that makes any
More information about the freebsd-usb