Data being reflected back from pty master
Hi
I've written some code which opens a pty master using the
posix_openpt(), grantpt() and unlockpt() group of functions and then a
child is forked which opens a slave to this master pty. It all seems
to work fine but the problem is that any data I write() to the master
file descriptor in the parent process seems to be reflected back as
well as being sent to the child descriptor and when I do a read() on
the master fd I get the data I just wrote along with any data from the
slave pty. Has anyone come across this sort of behaviour before on
linux?
Thanks for any help
B2003
Re: Data being reflected back from pty master
In article
<6908171d-8e04-4a76-9a46-5d27c4ce04ad@i76g2000hsf.googlegroups.com>,
Boltar <boltar2003@yahoo.co.uk> wrote:
[color=blue]
> I've written some code which opens a pty master using the
> posix_openpt(), grantpt() and unlockpt() group of functions and then a
> child is forked which opens a slave to this master pty. It all seems
> to work fine but the problem is that any data I write() to the master
> file descriptor in the parent process seems to be reflected back as
> well as being sent to the child descriptor and when I do a read() on
> the master fd I get the data I just wrote along with any data from the
> slave pty. Has anyone come across this sort of behaviour before on
> linux?[/color]
Run "stty -echo" in the child to turn off echoing.
--
Barry Margolin, [email]barmar@alum.mit.edu[/email]
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***