Technical data

SunOS 5.5 Devices pty(7D)
NAME pty pseudo-terminal driver
DESCRIPTION The pty driver provides support for a pair of devices collectively known as a pseudo-
terminal. The two devices comprising a pseudo-terminal are known as a controller and a
slave. The slave device distinguishesbetween the B0 baud rate and other baud rates
specified in the c_cflag word of the termios structure, and the CLOCAL flag in that word.
It does not support any of the other termio(7I) device control functions specified by flags
in the c_cflag word of the termios structure and by theIGNBRK, IGNPAR,PARMRK,or
INPCK flags in the c_iflag word of the termios structure, as these functions apply only to
asynchronous serial ports. All other termio(7I) functions must be performed by
STREAMS modules pushed atop the driver; when a slave device is opened, the
ldterm(7M) and ttcompat(7M) STREAMS modules are automatically pushed on top of the
stream, providing the standard termio(7I) interface.
Instead of having a hardware interface and associated hardware that supports the termi-
nal functions, the functions are implemented by another process manipulatingthe con-
troller device of the pseudo-terminal.
The controller and the slave devices of the pseudo-terminal are tightly connected. Any
data written on the controller device is givento the slave device as input, as though it had
been received from a hardware interface. Any data written on the slave terminal can be
read from the controller device (rather than being transmitted from a UART).
By default, 48 pseudo-terminal pairs are configured as follows:
/dev/pty[p-r][0-9a-f] controller devices
/dev/tty[p-r][0-9a-f] slave devices
IOCTLS The standard set of termio ioctls are supported by the slave device. None of the bits in
the c_cflag word have any effect on the pseudo-terminal, except that if the baud rate is set
to B0, it will appear to the process on the controller device as if the last process on the
slave device had closed the line; thus, setting the baud rate to B0 has the effect of ‘‘hang-
ing up’’ the pseudo-terminal, just as it has the effect of ‘‘hanging up’’ a real terminal.
There is no notion of ‘‘parity’’ on a pseudo-terminal, so none of the flags in the c_iflag
word that control the processing of parity errors have any effect. Similarly, there is no
notion of a ‘‘break’’, so none of the flags that control the processing of breaks, and none of
the ioctls that generate breaks, have any effect.
Input flow control is automatically performed; a process that attempts to write to the con-
troller device will be blocked if too much unconsumed data is buffered on the slave dev-
ice. The input flow control provided by theIXOFF flag in the c_iflag word is not sup-
ported.
The delays specified in the c_oflag word are not supported.
As there are no modems involved in a pseudo-terminal, the ioctls that return or alter the
state of modem control lines are silently ignored.
modified 8 Aug 1994 7D-267