Commit | Line | Data |
---|---|---|
16b5b9ce KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
260e89d5 | 5 | .\" @(#)pty.4 6.1 (Berkeley) %G% |
16b5b9ce | 6 | .\" |
260e89d5 | 7 | .TH PTY 4 "" |
16b5b9ce KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | pty \- pseudo terminal driver | |
11 | .SH SYNOPSIS | |
12 | .B pseudo-device pty | |
13 | .SH DESCRIPTION | |
14 | The | |
15 | .I pty | |
16 | driver provides support for a device-pair termed a | |
17 | .IR "pseudo terminal" . | |
18 | A pseudo terminal is a pair of character devices, a | |
19 | .I master | |
20 | device and a | |
21 | .I slave | |
22 | device. The slave device provides processes | |
23 | an interface identical | |
24 | to that described in | |
25 | .IR tty (4). | |
26 | However, whereas all other devices which provide the | |
27 | interface described in | |
28 | .IR tty (4) | |
29 | have a hardware device of some sort behind them, the slave | |
30 | device has, instead, another process manipulating | |
31 | it through the master half of the pseudo terminal. | |
32 | That is, anything written on the master device is | |
33 | given to the slave device as input and anything written | |
34 | on the slave device is presented as input on the master | |
35 | device. | |
36 | .PP | |
37 | In configuring, if no optional ``count'' is given in | |
38 | the specification, 16 pseudo terminal pairs are configured. | |
39 | .PP | |
40 | The following | |
41 | .I ioctl | |
42 | calls apply only to pseudo terminals: | |
43 | .TP | |
44 | TIOCSTOP | |
45 | Stops output to a terminal (e.g. like typing ^S). Takes | |
46 | no parameter. | |
47 | .TP | |
48 | TIOCSTART | |
49 | Restarts output (stopped by TIOCSTOP or by typing ^S). | |
50 | Takes no parameter. | |
51 | .TP | |
52 | TIOCPKT | |
53 | Enable/disable | |
54 | .I packet | |
55 | mode. Packet mode is enabled by specifying (by reference) | |
56 | a nonzero parameter and disabled by specifying (by reference) | |
57 | a zero parameter. When applied to the master side of a pseudo | |
58 | terminal, each subsequent | |
59 | .I read | |
60 | from the terminal will return data written on the slave part of | |
61 | the pseudo terminal preceded by a zero byte (symbolically | |
62 | defined as TIOCPKT_DATA), or a single byte reflecting control | |
63 | status information. In the latter case, the byte is an inclusive-or | |
64 | of zero or more of the bits: | |
65 | .RS | |
66 | .TP | |
67 | TIOCPKT_FLUSHREAD | |
68 | whenever the read queue for the terminal is flushed. | |
69 | .TP | |
70 | TIOCPKT_FLUSHWRITE | |
71 | whenever the write queue for the terminal is flushed. | |
72 | .TP | |
73 | TIOCPKT_STOP | |
74 | whenever output to the terminal is stopped a la ^S. | |
75 | .TP | |
76 | TIOCPKT_START | |
77 | whenever output to the terminal is restarted. | |
78 | .TP | |
79 | TIOCPKT_DOSTOP | |
80 | whenever | |
81 | .I t_stopc | |
82 | is ^S | |
83 | and | |
84 | .I t_startc | |
85 | is ^Q. | |
86 | .TP | |
87 | TIOCPKT_NOSTOP | |
88 | whenever the start and stop characters are not ^S/^Q. | |
89 | .RE | |
90 | .IP | |
91 | This mode is used by | |
92 | .IR rlogin (1C) | |
93 | and | |
94 | .IR rlogind (8C) | |
95 | to implement a remote-echoed, locally ^S/^Q flow-controlled | |
96 | remote login with proper back-flushing of output; it can be | |
97 | used by other similar programs. | |
98 | .TP | |
99 | TIOCREMOTE | |
100 | A mode for the master half of a pseudo terminal, independent | |
101 | of TIOCPKT. This mode causes input to the pseudo terminal | |
102 | to be flow controlled and not input edited (regardless of the | |
103 | terminal mode). Each write to the control terminal produces | |
104 | a record boundary for the process reading the terminal. In | |
105 | normal usage, a write of data is like the data typed as a line | |
106 | on the terminal; a write of 0 bytes is like typing an end-of-file | |
107 | character. TIOCREMOTE can be used when doing remote line | |
108 | editing in a window manager, or whenever flow controlled input | |
109 | is required. | |
110 | .SH FILES | |
111 | .DT | |
112 | /dev/pty[p-r][0-9a-f] master pseudo terminals | |
113 | .br | |
114 | /dev/tty[p-r][0-9a-f] slave pseudo terminals | |
115 | .SH DIAGNOSTICS | |
116 | None. | |
117 | .SH BUGS | |
118 | It is not possible to send an EOT. |