[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: poll(2)ing or select(2)ing /dev/usb0
- To: freebsd-usb_(_at_)_freebsd_(_dot_)_org
- Subject: Re: poll(2)ing or select(2)ing /dev/usb0
- From: Dirk GOUDERS <gouders_(_at_)_et_(_dot_)_bocholt_(_dot_)_fh-ge_(_dot_)_de>
- Date: Tue, 24 May 2005 22:52:19 +0200
> 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.
Ah yes, thank you, now I understand why my programs behave like they do.
To me, it looks as if the manual page usb(4) is a little bit misleading:
<excerpt>
USB CONTROLLER INTERFACE
Use the following to get access to the USB specific structures and
defines.
The /dev/usbN can be opened and a few operations can be performed on it.
The poll(2) system call will say that I/O is possible on the controller
device when a USB device has been connected or disconnected to the bus.
The following ioctl(2) commands are supported on the controller device:
</excerpt>
I understood the text in the following way:
"If you want to know if a device has been connected/disconnected, then
call poll(2) on /dev/usbN and if poll(2) says that descriptors are
ready, perform one of the ioctl(2) command to find out what exactly
happened."
Well, do I understand it right, that the only way to use poll(2) to
come to know if a device has been connected/disconnected to/from the
bus is to poll(2) /dev/usb (the event interface)? And therefore on a
machine that runs usbd(8), no other process can use poll(2), to come to
know about such events, but has to do it somehow else?
Dirk
_______________________________________________
freebsd-usb_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe_(_at_)_freebsd_(_dot_)_org"
Visit your host, monkey.org