 | | On BSD systems, where pseudo-terminals were first implemented, master pseudo-terminals have device names like /dev/ptyXX, and slave pseudo-terminals have names like /dev/ttyXX. The procedure for opening a pseudo-terminal is to cycle through all the possible masters, trying to open one. If the open fails, the device is already in use. Once the master side is open, the slave side can also be opened. The code looks something like this: | |
|