pty - Pseudo terminal driver
pseudo-device pty [count ]
The pty driver provides support for a device-pair termed a pseudo terminal. A pseudo terminal is a pair of character devices, a master device and a slave device. The slave device provides an interface identical to that described in the tty(7) reference page. However, whereas all other devices which provide the interface described in the tty reference page have a hardware device behind them, the slave device has, instead, another process manipulating it through the master half of the pseudo terminal. That is, anything written on the master device is given to the slave device as input and anything written on the slave device is presented as input on the master device.
The Tru64 UNIX operating system supports a STREAMS-based and clist-based implementation of the pty subsystem. The default configuration uses STREAMS-based ptys. STREAMS-based ptys use the options RPTY line in the kernel configuration file, while clist-based ptys use the pseudo-device, pty. By default, 32 pseudo-terminal special device files are created.
Note that you cannot have both types of ptys configured at the same time.
To enhance compatibility, STREAMS-based ptys offers two master pseudo terminal drivers, the BSD compatible master and the System V compatible master. The BSD master is a non-STREAMS device which interfaces to the STREAMS-based slave pty. The System V master is a STREAMS-based device which also interfaces to the STREAMS-based slave pty. The BSD master is opened through the cloning device, /dev/ptmx_bsd, and through the master pty special files, /dev/ptyXX. The System V master is opened only through the cloning device /dev/ptmx. Currently the BSD master cloning device is used by the libc routine openpty(3).
You should allocate ptys by using the openpty(3) function, which hides the pty name space that will change in the next major operating system release.
The following ioctl calls apply only to pseudo terminals: Returns the dev_t of the master file descriptor. ISPTM is valid only on the master half of the pseudo terminal, and takes no arguments. Stops output to a terminal (for example, like entering <ctrl-S>). Takes no parameter. Restarts output (stopped by TIOCSTOP or by typing <ctrl-S>). Takes no parameter. Enable or disable packet mode. Packet mode is enabled by specifying (by reference) a nonzero parameter and disabled by specifying (by reference) a zero parameter. When applied to the master side of a pseudo terminal, each subsequent read() from the terminal will return data written on the slave part of the pseudo terminal preceded by a zero byte (symbolically defined as TIOCPKT_DATA), or a single byte reflecting control status information. In the latter case, the byte is an inclusive-OR of zero or more of the bits: Whenever the read queue for the terminal is flushed. Whenever the write queue for the terminal is flushed. Whenever output to the terminal is stopped by <ctrl-S>. Whenever output to the terminal is restarted. Whenever t_stopc is <ctrl-S> and t_startc is <ctrl-Q>. Whenever the start and stop characters are not <ctrl-S> and <ctrl-Q>.
Master pseudo terminals Slave pseudo terminals System V master cloning device BSD master cloning device SVR4 slave pseudo terminal
System Administration delim off