]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man4/pty.4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man4 / pty.4
1 .\" Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Portions of this software were developed under sponsorship from Snow
5 .\" B.V., the Netherlands.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd August 20, 2008
31 .Dt PTY 4
32 .Os
33 .Sh NAME
34 .Nm pty
35 .Nd BSD-style and System V-style compatibility pseudo-terminal driver
36 .Sh SYNOPSIS
37 .Cd "device pty"
38 .Sh DESCRIPTION
39 The
40 .Nm
41 driver provides support for the traditional BSD naming scheme that was
42 used for accessing pseudo-terminals.
43 When the device
44 .Pa /dev/ptyXX
45 is being opened, a new terminal shall be created with the
46 .Xr pts 4
47 driver.
48 A device node for this terminal shall be created, which has the name
49 .Pa /dev/ttyXX .
50 .Pp
51 The
52 .Nm
53 driver also provides a cloning System V
54 .Pa /dev/ptmx
55 device.
56 .Pp
57 New code should not try to allocate pseudo-terminals using this
58 interface.
59 It is only provided for compatibility with older C libraries
60 that tried to open such devices when
61 .Xr posix_openpt 2
62 was being called.
63 .Sh FILES
64 The BSD-style compatibility pseudo-terminal driver uses the following
65 device names:
66 .Bl -tag -width ".Pa /dev/pty[l-sL-S][0-9a-v]"
67 .It Pa /dev/pty[l-sL-S][0-9a-v]
68 Pseudo-terminal master devices.
69 .It Pa /dev/tty[l-sL-S][0-9a-v]
70 Pseudo-terminal slave devices.
71 .It Pa /dev/ptmx
72 Control device, returns a file descriptor to a new master
73 pseudo-terminal when opened.
74 .El
75 .Sh DIAGNOSTICS
76 None.
77 .Sh SEE ALSO
78 .Xr posix_openpt 2 ,
79 .Xr pts 4 ,
80 .Xr tty 4
81 .Sh HISTORY
82 A
83 pseudo-terminal driver appeared in
84 .Bx 4.2 .
85 .Sh BUGS
86 Unlike previous implementations, the master and slave device nodes are
87 destroyed when the PTY becomes unused.
88 A call to
89 .Xr stat 2
90 on a nonexistent master device will already cause a new master device
91 node to be created.
92 The master device can only be destroyed by opening and closing it.
93 .Pp
94 The
95 .Nm
96 driver cannot be unloaded, because it cannot determine if it is being
97 used.