This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Need to replicate TIOCGICOUNT and TIOCMIWAIT on cygwin


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]