Disable/enable TIOCPKT in pty

po at volta.ece.utexas.edu po at volta.ece.utexas.edu
Sat Feb 11 11:40:20 AEST 1989


I posted this article to comp.unix.questions a few days ago, but still
haven't got any response.  I hope those familiar with pseudo terminals 
can shed some light on this ...

I am writing a program which makes use of a pseudo terminal
to communicate with a child process.

Everything works fine on a VAXstation II/GPX running Ultrix 2.3.
However, on Sun-3 and Sun-4, I cannot disable the packet mode 
of the pseudo terminal using the following code, as in the pty
man page:
	int n = 0;
	...
	ioctl(master, TIOCPKT, &n);
where master is the file descriptor of the master side.
So whatever is written to the slave side reappears on the 
master side on subsequent reads (which is very undesirable).

The above problem happens occasionally on a Sun-3 running SunOS 3.4.
Rebooting the machine solves the problem temporarily but the same
thing can happen again.
Rebooting the Sun-4 running SunOS 4.0 doesn't do the trick.

I guess there must be some way to reset the pseudo terminal 
characteristics so as to disable the packet mode? 
Does anyone have any successful experience with Sun pty's?

Thanks,
  Po		(po at volta.ece.utexas.edu)



More information about the Comp.unix.wizards mailing list