Data being reflected back from pty master - Unix

This is a discussion on Data being reflected back from pty master - Unix ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Data being reflected back from pty master

  1. 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

  2. Re: Data being reflected back from pty master

    In article
    <6908171d-8e04-4a76-9a46-5d27c4ce04ad@i76g2000hsf.googlegroups.com>,
    Boltar wrote:

    > 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?


    Run "stty -echo" in the child to turn off echoing.

    --
    Barry Margolin, barmar@alum.mit.edu
    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 ***

+ Reply to Thread