xref: /freebsd/share/man/man4/pty.4 (revision 195ebc7e9e4b129de810833791a19dfb4349d6a9)
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 compatibility pseudo-terminal driver
36.Sh SYNOPSIS
37.Cd "device pty"
38.Sh DESCRIPTION
39The
40.Nm
41driver provides support for the traditional BSD naming scheme that was
42used for accessing pseudo-terminals.
43When the device
44.Pa /dev/ptyXX
45is being opened, a new terminal shall be created with the
46.Xr pts 4
47driver.
48A device node for this terminal shall be created, which has the name
49.Pa /dev/ttyXX .
50.Pp
51New code should not try to allocate pseudo-terminals using this
52interface.
53It is only provided for compatibility with older C libraries
54that tried to open such devices when
55.Xr posix_openpt 2
56was being called.
57.Sh FILES
58The BSD-style compatibility pseudo-terminal driver uses the following
59device names:
60.Pp
61.Bl -tag -width ".Pa /dev/pty[l-sL-S][0-9a-v]"
62.It Pa /dev/pty[l-sL-S][0-9a-v]
63Pseudo-terminal master devices.
64.It Pa /dev/tty[l-sL-S][0-9a-v]
65Pseudo-terminal slave devices.
66.El
67.Sh DIAGNOSTICS
68None.
69.Sh SEE ALSO
70.Xr posix_openpt 2 ,
71.Xr pts 4 ,
72.Xr tty 4
73.Sh HISTORY
74A
75pseudo-terminal driver appeared in
76.Bx 4.2 .
77.Sh BUGS
78Unlike previous implementations, the master slave device nodes are
79destroyed when the PTY becomes unused.
80A call to
81.Xr stat 2
82on a nonexistent master device will already cause a new master device
83node to be created.
84The master device can only be destroyed by opening and closing it.
85.Pp
86The
87.Nm
88driver cannot be unloaded, because it cannot determine if it is being
89used.
90