delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/10/07:18:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Tue, 10 May 2005 13:16:56 +0200
From: Martin Koegler <mkoegler AT auto DOT tuwien DOT ac DOT at>
To: cygwin AT cygwin DOT com
Subject: Re: Bug in the /dev/ttySx handling code?
Message-ID: <20050510111656.GA31844@ahab.auto.tuwien.ac.at>
References: <20050509203526 DOT GA28389 AT ahab DOT auto DOT tuwien DOT ac DOT at>
Mime-Version: 1.0
In-Reply-To: <20050509203526.GA28389@ahab.auto.tuwien.ac.at>
User-Agent: Mutt/1.4.1i

On Mon, May 09, 2005 at 10:35:26PM +0200, Martin Koegler wrote:
> At least, I understand, why stty -F /dev/ttyS0 under cygwin return 0 baud:
> tcgetattr returns 0 baud, if DTR is not set, which is different to the behaviour of Linux.
> 
> I would like to track the problem down, but as the use of stty (and cat for doing IO) does not
> work, I have no idea, how to do it.

After some testing, I found the problem:
Cygwin stores the baud rate in c_ospeed of the termios struct, whereas Linux stores them in c_cflag.
Therefore all code storing the baud rate in c_cflag is not working on cygwin. Posix suggest using cfsetispeed()
and cfsetospeed() to set the baud rate in the termios structure, as the location for the baud rate is not specified.

mfg Martin Kögler

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