Subject: Re: Solaris emulation
To: None <port-sparc@NetBSD.ORG>
From: Christos Zoulas <christos@deshaw.com>
List: port-sparc
Date: 02/21/1996 02:22:00
In article <199602202132.QAA21227@wilma.cs.utk.edu> moore@cs.utk.edu (Keith Moore) writes:
>
>> Well, things haven't improved much.
>> The problem with stty is still here. Actually the behavior is really weird
>> since sttty settings tend to be changed by the mere fact of running Solaris
>> applications.
>
>One problem I've seen with just about every stty/termio/termios emulation
>since V7 is that any "foreign" program that does 
>
>gtty(&old);
>new=old ; 
>...twiddle bits in new...
>stty(&new)
>...
>stty(&old) 
>
>ends up not resetting the previous state of the terminal, because the 
>'foreign' emulation stored in 'old' doesn't completely represent the 'native' 
>state of the tty. 
>
>I've never actually tried it, but my idea for how to solve this would be
>to save the original native tty state the first time someone does a gtty
>(or modern-day equivalent) and also save the emulated tty state.
>if someone then tries to do an stty of the emulated tty state,
>(e.g. stty (&old)), and restore the original native tty state.

The problem is not that. The problem is that the termios and the old
stty functionality is a bit different [i.e. stty raw vs.
-imaxbel,-parenb,-brkintr,-isig,-istrip,cs8].  The kernel has to guess
what the user wants to do when it goes from raw to cooked, i.e. which
features to restore.

christos