Mail Archives: cygwin/2005/09/08/23:01:46
On Thu, Sep 08, 2005 at 06:47:07PM -0700, Peter Rehley wrote:
>Hi,
>
>I tried stty on snapshot 20050908 and I still get an error message:
>
>stty -F /dev/ttyS0 9600 ; # Different baud then current baud.
>stty: /dev/ttyS0: unable to perform all requested operations.
>
>If I issue the same command a second time I get no error message.
>
>I've traced the problem to /usr/include/sys/termios.h in the
>cfsetispeek and cfsetospeed macros. These set c_ispeed and c_ospeed
>values to set the baud rate, but the baud rate is also stored in
>c_cflag, and that value is not being set by these macros. It gets
>set when tcgetattr is called.
>
>When stty does a compare to see if the change was successfull it sees
>the original c_cflag and compares to the changed c_cflag and finds
>that they are different and issues the error message.... actually it
>does a simply memory compare, but these c_cflag values are different.
>
>One fix would be to change the macros so that they set the baud rate
>i c_cflag...of course stty (coreutils) would need to be recompiled
>for that changed to be picked up.
Since Cygwin always uses the c_ospeed value when setting the baud,
whatever shows up in c_cflag is meaningless. So, I've just refrained
from setting the CBAUD part of this field. I don't know if this will
break something else but it seems to work with stty.
While I was at it, I got 'stty -F /dev/ttyS0 -a' working, too.
These changes will be in the next snapshot.
Thanks for tracking this down.
cgf
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/
- Raw text -