X-Spam-Check-By: sourceware.org
Date: Thu, 28 Sep 2006 00:10:18 +0100
From: ahnkle <cygwin@ekers.idps.co.uk>
To: cygwin@cygwin.com
Subject: Re: tcgetattr problem
Message-ID: <20060927231017.GC29552@flixx.linux.bogus>
References: <20060927193049.GA29552@flixx.linux.bogus> <Pine.GSO.4.63.0609271833460.15013@access1.cims.nyu.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.GSO.4.63.0609271833460.15013@access1.cims.nyu.edu>
User-Agent: Mutt/1.5.11
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 18:36 Wed 27 Sep     , Igor Peshansky wrote:
> 
> #define PORT "com1"
> ...
>   fd = open(PORT, O_RDWR | O_NOCTTY );
> 
> There's your problem.  When you open a port as "com1", it looks like a
> file to Cygwin, since it doesn't recognize it as a valid device name.
> Thus any attempt to manipulate that fd as a device will fail.
> 
> Use the Cygwin device (e.g., "/dev/ttyS0").

Strangely, com1 *does* work in the call to open. Having tried "/dev/ttyS0",
tcgetattr() works ok.

I also note that read() and write() work ok too using "com1", but
tcsetattr() also fails.

BTW, I obtained the CVS source, but couldn't find the _ioctl() call 
anywhere in my (brief) grepping. Is there any documentation about internal
structure, and whats going on under the hood?

regards,
ahnkle


--
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/

