1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)pty.4 8.2 (Berkeley) 11/30/93
36 .Nd pseudo-terminal driver
40 driver provides support for a device-pair termed a
42 A pseudo-terminal is a pair of character devices, a
47 The slave device provides to a process an interface identical
50 However, whereas all other devices which provide the
51 interface described in
53 have a hardware device of some sort behind them, the slave
54 device has, instead, another process manipulating
55 it through the master half of the pseudo-terminal.
56 That is, anything written on the master device is
57 given to the slave device as input and anything written
58 on the slave device is presented as input on the master
63 calls apply only to pseudo-terminals:
64 .Bl -tag -width TIOCPTMASTER
69 Packet mode is enabled by specifying (by reference)
70 a nonzero parameter and disabled by specifying (by reference)
72 When applied to the master side of a pseudo-terminal, each subsequent
74 from the terminal will return data written on the slave part of
75 the pseudo-terminal preceded by a zero byte (symbolically
78 or a single byte reflecting control
80 In the latter case, the byte is an inclusive-or
81 of zero or more of the bits:
82 .Bl -tag -width TIOCPKT_FLUSHWRITE
83 .It Dv TIOCPKT_FLUSHREAD
84 whenever the read queue for the terminal is flushed.
85 .It Dv TIOCPKT_FLUSHWRITE
86 whenever the write queue for the terminal is flushed.
88 whenever output to the terminal is stopped a la
91 whenever output to the terminal is restarted.
101 .It Dv TIOCPKT_NOSTOP
102 whenever the start and stop characters are not
106 While this mode is in use, the presence of control status information
107 to be read from the master side may be detected by a
109 for exceptional conditions.
115 to implement a remote-echoed, locally
118 remote login with proper back-flushing of output; it can be
119 used by other similar programs.
121 Obtain device unit number, which can be used to generate the filename of
122 the pseudo-terminal slave device. This
124 should not be used directly. Instead, the
126 function should be used.
128 Determine whether the file descriptor is pointing to a pseudo-terminal
132 should not be used directly. It is used to implement routines like
136 The files used by this
137 pseudo-terminals implementation are:
138 .Bl -tag -width ".Pa /dev/pts/[num]"
139 .It Pa /dev/pts/[num]
140 Pseudo-terminal slave devices.
152 pseudo-terminal driver appeared in
156 it was replaced with the