linux – pty的slave端的进程是否与线路规则或slave tty驱动程序进行通信?

我发现了伪终端(pty)如何工作的两个矛盾图像.

第一张图显示pty从属端的进程与行规则对话:

linux  –  pty的slave端的进程是否与线路规则或slave tty驱动程序进行通信?

第二个图像显示pty从属端的进程与slave tty驱动程序通信:

linux  –  pty的slave端的进程是否与线路规则或slave tty驱动程序进行通信?

哪个图像是正确的?

解决方法:

第二张图片是正确的. (顺便说一句,它来了from here.)

this question接受的答复:

The line discipline is a software module (residing in the driver, in the kernel) pushed on top of a serial/pty device that sits between that device and the line/wire (the master side for a pty).

(…)

You can see the effect of disabling the tty line discipline by issuing stty raw -echo (note that the bash prompt or other interactive applications like vi set the terminal in the exact mode they need, so you want to use a dumb application like cat to experience with that). Then, everything that is written to the slave terminal device makes it immediately to the master side for xterm to read, and every character written by xterm to the master side is immediately available for reading from the slave device.

另见this post关于ttys.

上一篇:[JZOJ3402] 【GDOI2014模拟】Pty的字符串


下一篇:终端和伪终端的区别