Date: Sun, 22 Jan 2006 07:02:36 -0800 From: Robert Bruce <rab@mall.freebsdmall.com> To: freebsd-usb@freebsd.org Subject: Non-blocking I/O on bulk endpoints Message-ID: <20060122150236.CF2A11CDCF@mail.freebsdmall.com>
next in thread | raw e-mail | index | archive | help
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 difference. -bob
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060122150236.CF2A11CDCF>