Artificial intelligent assistant

Do pty devices have two input buffers? When terminal devices are in cooked mode, bytes input into terminal is cached and processed by kernel, some bytes are used for line editting and "cosumed", making `read` return one line a time. But for pty, Output to master fd can be read as input from slave fd and vice versa, so my question is: Do pty devices have two independent input buffers, unlike tty, one buffer per tty device?

A pty behaves as a normal tty. A normal tty has input (raw and cooked mode) and output queues.

With a pty, the tty output queue is connected to master input and the tty raw input is connected to master output. So it's not that there are more queues, it's that you can regard the tty output queue as input from the master's side.

**Added**

A pty is a normal tty. The generic tty part handles things like line editing, raw and cooked mode input, flow control like Ctrl+S and so on.

Every tty has a back end that handles actual input and output. This can be a serial driver. It can be the driver that interfaces with a keyboard and the VGA or frame buffer. It can also be a PTY master. In the case of a pty, the tty output is made available for the master to read, and the master writes are placed in the raw input queue.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5b8a1cf2b936d9083633d57e2a97c32c