pty.4 (68962) | pty.4 (76175) |
---|---|
1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)pty.4 8.2 (Berkeley) 11/30/93 | 1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)pty.4 8.2 (Berkeley) 11/30/93 |
33.\" $FreeBSD: head/share/man/man4/pty.4 68962 2000-11-20 18:41:33Z ru $ | 33.\" $FreeBSD: head/share/man/man4/pty.4 76175 2001-05-01 09:15:30Z schweikh $ |
34.\" 35.Dd November 30, 1993 36.Dt PTY 4 37.Os BSD 4.2 38.Sh NAME 39.Nm pty 40.Nd pseudo terminal driver 41.Sh SYNOPSIS | 34.\" 35.Dd November 30, 1993 36.Dt PTY 4 37.Os BSD 4.2 38.Sh NAME 39.Nm pty 40.Nd pseudo terminal driver 41.Sh SYNOPSIS |
42.Cd "pseudo-device pty" | 42.Cd "device pty" |
43.Sh DESCRIPTION 44The 45.Nm 46driver provides support for a device-pair termed a 47.Em pseudo terminal . 48A pseudo terminal is a pair of character devices, a 49.Em master 50device and a 51.Em slave 52device. The slave device provides to a process 53an interface identical 54to that described in 55.Xr tty 4 . | 43.Sh DESCRIPTION 44The 45.Nm 46driver provides support for a device-pair termed a 47.Em pseudo terminal . 48A pseudo terminal is a pair of character devices, a 49.Em master 50device and a 51.Em slave 52device. The slave device provides to a process 53an interface identical 54to that described in 55.Xr tty 4 . |
56However, whereas all other devices which provide the | 56However, whereas all other devices which provide the |
57interface described in 58.Xr tty 4 59have a hardware device of some sort behind them, the slave 60device has, instead, another process manipulating 61it through the master half of the pseudo terminal. 62That is, anything written on the master device is 63given to the slave device as input and anything written 64on the slave device is presented as input on the master 65device. 66.Pp | 57interface described in 58.Xr tty 4 59have a hardware device of some sort behind them, the slave 60device has, instead, another process manipulating 61it through the master half of the pseudo terminal. 62That is, anything written on the master device is 63given to the slave device as input and anything written 64on the slave device is presented as input on the master 65device. 66.Pp |
67The following | 67The following |
68.Xr ioctl 2 69calls apply only to pseudo terminals: 70.Bl -tag -width TIOCREMOTE 71.It Dv TIOCSTOP 72Stops output to a terminal (e.g. like typing 73.Ql ^S ) . 74Takes 75no parameter. 76.It Dv TIOCSTART 77Restarts output (stopped by 78.Dv TIOCSTOP 79or by typing 80.Ql ^S ) . 81Takes no parameter. 82.It Dv TIOCPKT | 68.Xr ioctl 2 69calls apply only to pseudo terminals: 70.Bl -tag -width TIOCREMOTE 71.It Dv TIOCSTOP 72Stops output to a terminal (e.g. like typing 73.Ql ^S ) . 74Takes 75no parameter. 76.It Dv TIOCSTART 77Restarts output (stopped by 78.Dv TIOCSTOP 79or by typing 80.Ql ^S ) . 81Takes no parameter. 82.It Dv TIOCPKT |
83Enable/disable | 83Enable/disable |
84.Em packet 85mode. Packet mode is enabled by specifying (by reference) 86a nonzero parameter and disabled by specifying (by reference) 87a zero parameter. When applied to the master side of a pseudo | 84.Em packet 85mode. Packet mode is enabled by specifying (by reference) 86a nonzero parameter and disabled by specifying (by reference) 87a zero parameter. When applied to the master side of a pseudo |
88terminal, each subsequent | 88terminal, each subsequent |
89.Xr read 2 90from the terminal will return data written on the slave part of 91the pseudo terminal preceded by a zero byte (symbolically 92defined as 93.Dv TIOCPKT_DATA ) , 94or a single byte reflecting control 95status information. In the latter case, the byte is an inclusive-or 96of zero or more of the bits: 97.Bl -tag -width TIOCPKT_FLUSHWRITE 98.It Dv TIOCPKT_FLUSHREAD 99whenever the read queue for the terminal is flushed. 100.It Dv TIOCPKT_FLUSHWRITE 101whenever the write queue for the terminal is flushed. 102.It Dv TIOCPKT_STOP 103whenever output to the terminal is stopped a la 104.Ql ^S . 105.It Dv TIOCPKT_START 106whenever output to the terminal is restarted. 107.It Dv TIOCPKT_DOSTOP | 89.Xr read 2 90from the terminal will return data written on the slave part of 91the pseudo terminal preceded by a zero byte (symbolically 92defined as 93.Dv TIOCPKT_DATA ) , 94or a single byte reflecting control 95status information. In the latter case, the byte is an inclusive-or 96of zero or more of the bits: 97.Bl -tag -width TIOCPKT_FLUSHWRITE 98.It Dv TIOCPKT_FLUSHREAD 99whenever the read queue for the terminal is flushed. 100.It Dv TIOCPKT_FLUSHWRITE 101whenever the write queue for the terminal is flushed. 102.It Dv TIOCPKT_STOP 103whenever output to the terminal is stopped a la 104.Ql ^S . 105.It Dv TIOCPKT_START 106whenever output to the terminal is restarted. 107.It Dv TIOCPKT_DOSTOP |
108whenever | 108whenever |
109.Em t_stopc 110is 111.Ql ^S | 109.Em t_stopc 110is 111.Ql ^S |
112and | 112and |
113.Em t_startc 114is 115.Ql ^Q . 116.It Dv TIOCPKT_NOSTOP 117whenever the start and stop characters are not 118.Ql ^S/^Q . 119.Pp 120While this mode is in use, the presence of control status information --- 21 unchanged lines hidden (view full) --- 142.Dv TIOCUCNTL 143and 144.Dv TIOCPKT 145modes are mutually exclusive. 146This mode is enabled from the master side of a pseudo terminal 147by specifying (by reference) 148a nonzero parameter and disabled by specifying (by reference) 149a zero parameter. | 113.Em t_startc 114is 115.Ql ^Q . 116.It Dv TIOCPKT_NOSTOP 117whenever the start and stop characters are not 118.Ql ^S/^Q . 119.Pp 120While this mode is in use, the presence of control status information --- 21 unchanged lines hidden (view full) --- 142.Dv TIOCUCNTL 143and 144.Dv TIOCPKT 145modes are mutually exclusive. 146This mode is enabled from the master side of a pseudo terminal 147by specifying (by reference) 148a nonzero parameter and disabled by specifying (by reference) 149a zero parameter. |
150Each subsequent | 150Each subsequent |
151.Xr read 2 152from the master side will return data written on the slave part of 153the pseudo terminal preceded by a zero byte, 154or a single byte reflecting a user control operation on the slave side. 155A user control command consists of a special 156.Xr ioctl 2 157operation with no data; the command is given as 158.Dv UIOCCMD Ns (n) , --- 50 unchanged lines hidden --- | 151.Xr read 2 152from the master side will return data written on the slave part of 153the pseudo terminal preceded by a zero byte, 154or a single byte reflecting a user control operation on the slave side. 155A user control command consists of a special 156.Xr ioctl 2 157operation with no data; the command is given as 158.Dv UIOCCMD Ns (n) , --- 50 unchanged lines hidden --- |