delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/04/04:48:16

From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson)
Subject: Re: Opening COM2
4 Apr 1997 04:48:16 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199704040408.OAA02825.cygnus.gnu-win32@mundook.cs.mu.OZ.AU>
Original-To: rwilson AT cfawilson DOT harvard DOT edu (Bob Wilson)
Original-Cc: gnu-win32 AT cygnus DOT com (gnu-win32)
In-Reply-To: <199704032002.PAA00930@cfawilson.harvard.edu> from "Bob Wilson" at Apr 3, 97 03:02:58 pm
X-Mailer: ELM [version 2.4 PL24]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Bob Wilson, you wrote:
> 
> I have a program which ran correctly when compiled on a gnu-win32
> package from about a year ago, but is failing when compiled with 17.1
> beta.  The machine is running NT 3.51 and COM2 is connected to a
> microprocessor with only td, rd and ground connected.  The open:
> 
>         if ((comfd = open("com2", O_RDWR | O_TEXT)) <= 0) {
>             fprintf(stderr, "Cmd: Unable to open terminal\n");
>             exit(1);
>         }
> 
> hangs.  It doesn't help to tie the modem control lines high, but if I
> generate a few characters on the rd line, the open completes.  In no
> case is there an error return.

My guess is that this is due to the symbolic link handling.
When you open a file, cygwin will read the first few bytes
of the file to see if it has the special marker that is used
to indicate a symbolic link; if so, then cygwin will open the
file that the link points to.  Obviously this won't work
correctly in the case of device files such as `com2'...

-- 
Fergus Henderson <fjh AT cs DOT mu DOT oz DOT au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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