title: How to use pseudo-terminals in Linux with C?
body: <p>I'm trying to figure out how to use pseudo-terminal's in linux, essentially I want to create a telnetd clone, something I mentioned <a href="https://stackoverflow.com/questions/8283524/attaching-to-processes-in-c">in an earlier question</a>.</p>
  
  <p>I understand the concept of master and slave terminal, and I have a basic grasp on how to use syscalls in C.</p>
  
  <p>My question concerns the next step after opening a slave / master file descriptor. How to I launch getty in the slave? Are there any <em>good</em> resources on the net for using the forkpty(), openpty(),or another API?</p>
  
  <p>Some examples in C would help. <a href="https://stackoverflow.com/questions/476354/how-do-nix-pseudo-terminals-work-whats-the-master-slave-channel">This was a very similar question</a>, but no one really provided any examples.</p>