0

What type of terminal is created when creating a pseudoterminal through open_pty()?

I've wondered how the pseudoterminal opened by open_pty() behaves? Is the behavior of the pseudoterminal similar to GNOME terminal in terms of input/output, or what kind of terminal does the pseudoterminal mimicks?

Using a C-program, I've opened a pseudoterminal (after fork()) through open_pty() and made it a login terminal through login_pty(). Then, I've used the execv() call to execute sh such that the parent and child processes can communicate through the master/slave ends of the pseudoterminal.

In particular, I notice how input to pty is sent to sh and how output from sh is sent to the stdout of the pty - is this correct?

Shuzheng
  • 11,288
  • 20
  • 88
  • 186

0 Answers0