This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in the /dev/ttySx handling code?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]