From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82950 invoked by alias); 28 May 2015 10:04:48 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 82936 invoked by uid 89); 28 May 2015 10:04:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 May 2015 10:04:46 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id B73B0A8056E; Thu, 28 May 2015 12:04:43 +0200 (CEST) Date: Thu, 28 May 2015 10:55:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: File operations on a Windows Driver (character device) Message-ID: <20150528100443.GP16927@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <5559FB9E.3040200@cygwin.com> <20150527120908.GE16927@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w6U88vdWm8UqIXvc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-05/txt/msg00379.txt.bz2 --w6U88vdWm8UqIXvc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1585 On May 27 17:56, Alessio Faina wrote: > Thanks Mark and Corinna. > I'm sorry for the > and > ., > I wont make those mistakes in the future, I promise. >=20 > Returning on the issue, I've decided to open the device with the > open() provided by Cygwin > and then intercept the IOCTLs and change them with the Win32 > DeviceIoControl (using > _get_osfhandle() for the handle of the device). > At this point I can even implement the mmap with an IOCTL without > problems as I explained > in a previous mail. > I cannot use the read/write calls because I need to access the kernel > memory directly with > the mmap; in this way I can get better performances. >=20 > The last (and main) problem I'm facing is the poll()/select(); I've > seen that doing a poll() on > this kind of device always returns "1" because in > select.cc->select_stuff::poll() the function > pointer s->peek is NULL and in that way the counter "n" is always increas= ed. >=20 > What I need to do is something that can be compiled under VS2013 and > under Cygwin > for compatibility with applications already written for linux OS; That's a problem. For Cygwin to recognize a device it needs support in CYgwin itself. What you probably need to write is some kind of userspace access library which translates the required POSIX calls to Windows calls when accessing your device. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --w6U88vdWm8UqIXvc Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVZug7AAoJEPU2Bp2uRE+gxLgP/ApE61iwcOyAtMHASJJh/E8I +TejHW3ft3CDdxq79OqdGcqgyeUeeGcLEEdFmH3H8DTkoSxPpviULYjWUUWZAUCX GEPXmAvSPum3ntiGwMFxCgGtzlpSaswR5WNIfvTlyVXTvNpaX2cyq/eZBQLbk09E ZEdf1ukGdHpUKiheNHO+/+iPO8WjkFeRATv6BSrHKg+/yTyTUnuq+wrHtNXyMr+a isatCLfKzxHyzb3W4uFNrWKn5shvsGJb58MPoOJVmRcj6UrUE4lBMndUVJkiwb07 DwF+objzXn8pcDROjgxDdplTm3badIUgU5blSJgw2DVClynTOsVReAPiPnGzZZQU 2qNRQk3dMee501+2VKpdJlEDsHla6OZ7/oQR6n9v0v9tTY7+RxmnAPTwVcByl97p CCBaubkPigLEGsQ4ZID6hOyhTt/miMcPYe3kufcOLyVvWsb+id6hyDeBkBx9sBFP hI0KUOXG2tBCZux2S8CLx3fYna3zAmiL6dMy1VUZS36CcnTjMh/Qp5m3FKjZ0IK4 8inHj4/z1zkXsjgFLcwXhT0eRHZUPji2AyJR8ApeMzBGQTeX9e3hWnnSyYC0tgGW DKvNctbo6krfbdlU0LWUQti7RWntjXkhjuRWqUU+XNB+/AgrrCChwiaUrZWwrqOj iBEz08PINFPVjHTprQN9 =ySdZ -----END PGP SIGNATURE----- --w6U88vdWm8UqIXvc--