pty(7) DG/UX 4.30 pty(7)
NAME
pty, pts, ptc - pseudo-terminal master/slave pseudo-device
pair
DESCRIPTION
A pseudo-terminal (pty) is a pair of character devices, a
master device and a slave device. The master device is
supported by the ptc driver and the slave device is
supported by the pts driver.
The slave device provides processes a standard tty interface
as described in termio(7) and tty(7). However, whereas
other devices which provide the tty interface have a
hardware device of some sort 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 following ioctl calls apply only to pseudo terminals:
TIOCSTOP
Stops output to a terminal (e.g. like typing <Ctrl-S).
Takes no parameter.
TIOCSTART
Restarts output (stopped by TIOCSTOP or by typing
<Ctrl-S>). Takes no parameter.
TIOCPKT
Enable/disable packet mode. The ioctl parameter is the
address of an int, whose value determines whether
packet mode is to be enabled (non-zero value) or
disabled (zero value). 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:
TIOCPKT_FLUSHREAD
whenever the read queue for the terminal is flushed.
TIOCPKT_FLUSHWRITE
whenever the write queue for the terminal is flushed.
TIOCPKT_STOP
whenever output to the terminal is stopped with <Ctrl-
S>.
Licensed material--property of copyright holder(s) Page 1
pty(7) DG/UX 4.30 pty(7)
TIOCPKT_START
whenever output to the terminal is restarted.
TIOCPKT_DOSTOP
whenever t_stopc is <Ctrl-C> and t_startc is <Ctrl-Q>.
TIOCPKT_NOSTOP
whenever the start and stop characters are not <Ctrl-
S/Ctrl-^Q>.
While this mode is in use, the presence of control
status information to be read from the master side may
be detected by a select for exceptional conditions.
TIOCUCNTL
Enable/disable a mode that allows a small number of
simple user ioctl commands to be passed through the
pseudo-terminal, using a protocol similar to that of
TIOCPKT. The TIOCUCNTL and TIOCPKT modes are mutually
exclusive. This mode is enabled from the master side
of a pseudo terminal by specifying (by reference) a
nonzero parameter and disabled by specifying (by
reference) a zero parameter. Each subsequent read from
the master side will return data written on the slave
part of the pseudo terminal preceded by a zero byte, or
a single byte reflecting a user control operation on
the slave side. A user control command consists of a
special ioctl operation with no data; the command is
given as UIOCCMD(n), where n is a number in the range
1-255. The operation value n will be received as a
single byte on the next read from the master side. The
ioctl UIOCCMD(0) is a no-op that may be used to probe
for the existence of this facility. As with TIOCPKT
mode, command operations may be detected with a select
for exceptional conditions.
TIOCREMOTE
A mode for the master half of a pseudo terminal,
independent of TIOCPKT. This mode causes input to the
pseudo terminal to be flow controlled and not input
edited (regardless of the terminal mode). Each write
to the control terminal produces a record boundary for
the process reading the terminal. In normal usage, a
write of data is like the data typed as a line on the
terminal; a write of 0 bytes is like typing an end-of-
file character. TIOCREMOTE can be used when doing
remote line editing in a window manager, or whenever
flow controlled input is required.
TIOCCONS
Enable/disable console output redirection. This
slave-side ioctl call causes all output to /dev/syscon
Licensed material--property of copyright holder(s) Page 2
pty(7) DG/UX 4.30 pty(7)
to go to the pty output instead. Note that input is
not redirected. The command parameter is the address
of an integer. If this integer is zero, the call
cancels redirection; if non-zero, it establishes
redirection.
FILES
/dev/ttyp* /dev/ptyp*
SEE ALSO
termio(7), tty(7)
Licensed material--property of copyright holder(s) Page 3