delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/29/08:07:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 29 Apr 2004 14:07:09 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Need to replicate TIOCGICOUNT and TIOCMIWAIT on cygwin
Message-ID: <20040429120709.GE17535@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <loom DOT 20040427T053617-292 AT post DOT gmane DOT org> <loom DOT 20040427T075714-582 AT post DOT gmane DOT org> <Pine DOT CYG DOT 4 DOT 58 DOT 0404271140220 DOT 5560 AT fordpc DOT vss DOT fsi DOT com>
Mime-Version: 1.0
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 AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019