Subject: wierdness involving TIOCSETP compat routines
To: None <current-users@NetBSD.ORG>
From: Greg Wohletz <greg@duke.CS.UNLV.EDU>
List: current-users
Date: 07/18/1996 14:39:10
The   following piece  of  code  has  the undesirable   side effect of
clearing the OPOST flag on the pty in SOME cases:

#include <sys/ioctl.h>
#include <sgtty.h>
main()
{
	int tty;
	struct sgttyb sg,sgorig;

	tty = open("/dev/tty",2);
	ioctl(tty, TIOCGETP, &sgorig);
	sg = sgorig;
	sg.sg_flags |= RAW;
	sg.sg_flags &= ~ECHO;
	ioctl(tty, TIOCSETP, &sg);
	sleep(2);
	ioctl(tty, TIOCSETP, &sgorig);
}


Is this a known   problem with the  compat  code?  I discovered   this
because this  is exactly  what the  resize  (the xterm  thing) program
does.

Obviously it would  be easy to recode  resize to use termios, but  I'm
curious as  to what is going  on, and if  anyone knows what particular
state information in a particular pty will cause this to happen or not
happen.

This is under NetBSD 1.1 running X V11R6.1

						--Greg