Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Thu, 29 Apr 2004 14:07:09 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Need to replicate TIOCGICOUNT and TIOCMIWAIT on cygwin
Message-ID: <20040429120709.GE17535@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <loom.20040427T053617-292@post.gmane.org> <loom.20040427T075714-582@post.gmane.org> <Pine.CYG.4.58.0404271140220.5560@fordpc.vss.fsi.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.CYG.4.58.0404271140220.5560@fordpc.vss.fsi.com>
User-Agent: Mutt/1.4.2i

On Apr 27 11:50, Brian Ford wrote:
> On Tue, 27 Apr 2004, Jim Brain wrote:
> > All the examples online use CreateFile, which I coded up, and cygwin
> > gives me a fd of 8, but select returns immediately and I read -1 bytes
> > on serial.  I looked at the cygwin source, which uses NtCreateFile, but
> > I can't find headers or libraries for that. I am stumped.  I feel like I

Weird.  NtCreateFile is documented in MSDN.

> > am so close...  It's rather a bummer there is a not a
> > cygwin_get_win32_handle(int fd), as that is what I need.

  #include <io.h>
  HANDLE h = (HANDLE) get_osfhandle (fd);
 
> AFAIK, the NtCreateFile change is a very recent one, only available in
> fairly recent snapshots.  It has a bug in that it doesn't support win32
> device paths and thus the internally defined path to the COM ports.
> Hopefully, that will be fixed soon.

Looks like a simple path handling problem.  The current code doesn't
recognize "\\.\" paths.  A fix should be fairly easy, just replace
"\\.\" by "\??\".  So far it always replaces leading "\\" by "\??\UNC\"
so Win32 device names are treated like network paths.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

