poll(2)ing or select(2)ing /dev/usb0

Hans Petter Selasky hselasky at c2i.net
Tue May 24 19:22:22 GMT 2005


On Tuesday 24 May 2005 12:53, Dirk Gouders wrote:
> Hello,
>
> in the section USB CONTROLLER INTERFACE the manual page usb(4) says
> that one can use poll(2) on /dev/usbN to get noticed when USB devices
> are connected or disconnected.
>
> Now, I wrote two small programs to play with poll(2) and select(2)
> on /dev/usb0 and see what happens if I connect/disconnect a USB
> device, but nothing happens.  As the manual page does not say
> what events to poll(2) for, I just turned on all bits in the events
> mask and the programs work fine on the event interface /dev/usb.
>

You cannot read data from /dev/usbN, only ioctls are possible on those 
devices.

See "/sys/dev/usb/usb.c" (usbpoll), if you got the source code installed.

--HPS


More information about the freebsd-usb mailing list