Find the answer to your Linux question:
Results 1 to 5 of 5
We are trying to simulate something very similar to ssh which is why we need to use pseudo terminals. We've tried creating the master-slave pair using forkpty. Here we are ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    3

    Pseudo terminal help

    We are trying to simulate something very similar to ssh which is why we need to use pseudo terminals. We've tried creating the master-slave pair using forkpty.
    Here we are assuming the child process is the slave but we cant see the output of the child process anywhere. ( for starters we've just put a printf here ) .Because we could not see the output any where, we redirected STDOUT within the child to a separate file. Here we got the output in the file.

    So we are not able to figure out how to get the output of the slave terminal and how to establish a connection between the master and slave.
    So can anyone tell me if i am on the right track and what exactly should be the program flow ??

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I wrote a program using pty's once. You might be interested in looking at the source. I will keep it there for at least two weeks.

    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    3
    hey..thanks a lot..i'll check it out..

  4. #4
    Just Joined!
    Join Date
    Mar 2008
    Posts
    3
    hey..your code really helped us understand the working of pseudo terminals. It worked for us.. we managed to get our thing working! Thanks a lot for the help!!

  5. #5
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Glad to help.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...