From owner-freebsd-usb@FreeBSD.ORG Fri Jul 23 17:24:48 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3054106566C for ; Fri, 23 Jul 2010 17:24:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id 5F80B8FC17 for ; Fri, 23 Jul 2010 17:24:47 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=AloUlVQQLuutPgH7MSFGD/V8MYI3aUCj623mET0KTys= c=1 sm=1 a=LKpx1GHAifUA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=8kQB0OdkAAAA:8 a=4d79Pp89qbVUHLkU1tUA:9 a=9aU92bICug9c7kJ7BTBGOi8A-5MA:4 a=wPNLvfGTeEIA:10 a=9aOQ2cSd83gA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:117 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 847081; Fri, 23 Jul 2010 19:24:41 +0200 From: Hans Petter Selasky To: Peer Stritzinger Date: Fri, 23 Jul 2010 19:21:45 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <201007231657.47682.hselasky@c2i.net> In-Reply-To: X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201007231921.45803.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: FreeBSD 8: libusb async mode + select(2) = nogo? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 17:24:48 -0000 On Friday 23 July 2010 19:12:46 Peer Stritzinger wrote: > Hi, > > On Fri, Jul 23, 2010 at 4:57 PM, Hans Petter Selasky wrote: > > What are the polling flags you are using? > > Do you mean the libusb_pollfd entries? > > They are: > > {fd = 0x7, events = 0x1} > {fd = 0xc, events = 0x45} > > I translate these into select(2) params like this: > > nfds = 0xc, readfds = {__fds_bits = {0x1080, 0x0 }}, > writefds = {__fds_bits = {0x1000, 0x0 }}, exceptfds = { > __fds_bits = {0x0 }}, > > And call select with timeout = NULL (since libusb_get_next_timeout returned > 0) Should work, but it might be that the second poll, when you try to process the events, don't work like expected. After any event on the two fd's you should call "libusb_handle_events_locked()" using a "tv = NULL". --HPS