Pseudo Terminal - BSD PTYs

BSD PTYs

In the BSD PTY system, the slave device file, which generally has a nomenclature similar to /dev/tty, supports the system calls of any text terminal device. Thus it supports login sessions. The master device file, which generally has a nomenclature similar to /dev/pty, is the endpoint for communication with the terminal emulator.

With the aforementioned naming scheme there can be at most 256 tty pairs. Also, finding the first free pty master can be racy unless a locking scheme is adopted. For that reason, modern BSD operating systems, such as FreeBSD, implement Unix98 PTYs.

Read more about this topic:  Pseudo Terminal