Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 May 2005 21:22:52 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org, Dirk Gouders <gouders@et.bocholt.fh-ge.de>
Subject:   Re: poll(2)ing or select(2)ing /dev/usb0
Message-ID:  <200505242122.53801.hselasky@c2i.net>
In-Reply-To: <200505241053.j4OArR2c000390@musashi.et.bocholt.fh-gelsenkirchen.de>
References:  <200505241053.j4OArR2c000390@musashi.et.bocholt.fh-gelsenkirchen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505242122.53801.hselasky>