From owner-freebsd-usb@FreeBSD.ORG Fri Jul 23 15:00:50 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 199BC106566B for ; Fri, 23 Jul 2010 15:00:50 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.freebsd.org (Postfix) with ESMTP id 97DF18FC13 for ; Fri, 23 Jul 2010 15:00:49 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=6KUfmzbym87FxoMGRWTr46e60yW4QTEOPMCHQyBOt0U= c=1 sm=1 a=LKpx1GHAifUA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=Ic9AYebQkvOSOBomF6wA:9 a=74XnwA0x_MHJ_IfIWguVeN3zpsIA:4 a=wPNLvfGTeEIA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:117 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1150878; Fri, 23 Jul 2010 17:00:46 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Fri, 23 Jul 2010 16:57:47 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-PRERELEASE; KDE/4.4.5; amd64; ; ) References: 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: <201007231657.47682.hselasky@c2i.net> Cc: 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 15:00:50 -0000 On Friday 23 July 2010 15:36:14 Peer Stritzinger wrote: > Hi, > > I'm using libusb to talk to a generic device (thats being also > developed by me), synchronous works fine now. > > Asynchronous mode with blocking libusb_handle_events() works also. > > Now I'm trying to also talk to non USB file descriptors. For this I'm > using select(2), filling the sets from libusb_get_pollfds() results. > > Somehow the select call never returns (no timeouts), if It gets some > external trigger (like stopping in the debugger can continuing) it > returns and has plausible return values. > > Looking into libusb I find that it uses poll(2) internally. > > Is select(2) supposed to work with libusb fd'? > > Should I rather use poll(2)? (I do like select more -- more BSDish). > What are the polling flags you are using? --HPS