From owner-freebsd-usb@FreeBSD.ORG Tue May 24 19:22:22 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D03916A41C for ; Tue, 24 May 2005 19:22:22 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0ED6143D48 for ; Tue, 24 May 2005 19:22:18 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-217-200-254.daxnet.no ([193.217.200.254] verified) by mailfe01.swip.net (CommuniGate Pro SMTP 4.3c5) with ESMTP id 379462787; Tue, 24 May 2005 21:22:06 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, Dirk Gouders Date: Tue, 24 May 2005 21:22:52 +0200 User-Agent: KMail/1.7 References: <200505241053.j4OArR2c000390@musashi.et.bocholt.fh-gelsenkirchen.de> In-Reply-To: <200505241053.j4OArR2c000390@musashi.et.bocholt.fh-gelsenkirchen.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505242122.53801.hselasky@c2i.net> Cc: Subject: Re: poll(2)ing or select(2)ing /dev/usb0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2005 19:22:22 -0000 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