How to use pseudo-terminals in Linux with C?

后端 未结 3 2024
青春惊慌失措
青春惊慌失措 2020-12-03 17:42

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 in an earlier question.

I under

3条回答
  •  独厮守ぢ
    2020-12-03 17:57

    You don't lauch a getty for ptys. The getty is only the "listener" part of the process. For hardwired terminals, each individual terminal-device is "listening" constantly. For telnet, the daemon does the listening part(on a socket), and handles connection request by creating a pty pair, and fork()ing / exec()ing. And indeed: APUE handles ptys very well.

提交回复
热议问题