Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Date: Tue, 10 May 2005 11:32:08 -0400 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: Bug in the /dev/ttySx handling code? Message-ID: <20050510153208.GY15665@trixie.casa.cgf.cx> Reply-To: cygwin@cygwin.com References: <20050509203526.GA28389@ahab.auto.tuwien.ac.at> <20050510111656.GA31844@ahab.auto.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050510111656.GA31844@ahab.auto.tuwien.ac.at> User-Agent: Mutt/1.5.8i On Tue, May 10, 2005 at 01:16:56PM +0200, Martin Koegler wrote: >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. Hmm, linux does have c_ispeed and c_ospeed elements in the termios structure. cgf -- 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/