delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/09/27/22:13:49

X-Spam-Check-By: sourceware.org
Date: Wed, 27 Sep 2006 22:13:36 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: tcgetattr problem
Message-ID: <20060928021335.GD31675@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20060927193049 DOT GA29552 AT flixx DOT linux DOT bogus> <Pine DOT GSO DOT 4 DOT 63 DOT 0609271833460 DOT 15013 AT access1 DOT cims DOT nyu DOT edu> <20060927231017 DOT GC29552 AT flixx DOT linux DOT bogus>
Mime-Version: 1.0
In-Reply-To: <20060927231017.GC29552@flixx.linux.bogus>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

On Thu, Sep 28, 2006 at 12:10:18AM +0100, ahnkle wrote:
>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.

"It looks like a file to Cygwin"

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

"It looks like a file to Cygwin"

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

The name of the function is "ioctl", not "ioctl".

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