Deleted Added
full compact
pty.3 (112541) pty.3 (131504)
1.\"
2.\" Copyright (c) 1996 Joerg Wunsch
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 9 unchanged lines hidden (view full) ---

18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
1.\"
2.\" Copyright (c) 1996 Joerg Wunsch
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 9 unchanged lines hidden (view full) ---

18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/lib/libutil/pty.3 112541 2003-03-24 16:02:05Z charnier $
26.\" $FreeBSD: head/lib/libutil/pty.3 131504 2004-07-02 23:52:20Z ru $
27.\" "
28.Dd December 29, 1996
29.Os
30.Dt PTY 3
31.Sh NAME
32.Nm openpty ,
33.Nm forkpty
34.Nd auxiliary functions to obtain a pseudo-terminal

--- 22 unchanged lines hidden (view full) ---

57invalidate any current use of the line by calling
58.Xr revoke 2 .
59.Pp
60If the argument
61.Fa name
62is not
63.Dv NULL ,
64.Fn openpty
27.\" "
28.Dd December 29, 1996
29.Os
30.Dt PTY 3
31.Sh NAME
32.Nm openpty ,
33.Nm forkpty
34.Nd auxiliary functions to obtain a pseudo-terminal

--- 22 unchanged lines hidden (view full) ---

57invalidate any current use of the line by calling
58.Xr revoke 2 .
59.Pp
60If the argument
61.Fa name
62is not
63.Dv NULL ,
64.Fn openpty
65copies the pathname of the slave pty to this area. The caller is
65copies the pathname of the slave pty to this area.
66The caller is
66responsible for allocating the required space in this array.
67.Pp
68If the arguments
69.Fa termp
70or
71.Fa winp
72are not
73.Dv NULL ,

--- 7 unchanged lines hidden (view full) ---

81and
82.Fa aslave ,
83respectively.
84.Pp
85The
86.Fn forkpty
87function first calls
88.Fn openpty
67responsible for allocating the required space in this array.
68.Pp
69If the arguments
70.Fa termp
71or
72.Fa winp
73are not
74.Dv NULL ,

--- 7 unchanged lines hidden (view full) ---

82and
83.Fa aslave ,
84respectively.
85.Pp
86The
87.Fn forkpty
88function first calls
89.Fn openpty
89to obtain the next available pseudo-terminal from the system. Upon success,
90it forks off a new process. In the child process, it closes the descriptor
90to obtain the next available pseudo-terminal from the system.
91Upon success,
92it forks off a new process.
93In the child process, it closes the descriptor
91for the master side of the pty, and calls
92.Xr login_tty 3
94for the master side of the pty, and calls
95.Xr login_tty 3
93for the slave pty. In the parent process, it closes the descriptor for the
94slave side of the pty. The arguments
96for the slave pty.
97In the parent process, it closes the descriptor for the
98slave side of the pty.
99The arguments
95.Fa amaster ,
96.Fa name ,
97.Fa termp ,
98and
99.Fa winp
100have the same meaning as described for
101.Fn openpty .
102.Sh RETURN VALUES

--- 25 unchanged lines hidden (view full) ---

128.Xr open 2 ,
129.Xr revoke 2 ,
130.Xr login_tty 3 ,
131.Xr pty 4 ,
132.Xr termios 4 ,
133.Xr group 5
134.Sh BUGS
135The calling process must have an effective UID of super-user in order
100.Fa amaster ,
101.Fa name ,
102.Fa termp ,
103and
104.Fa winp
105have the same meaning as described for
106.Fn openpty .
107.Sh RETURN VALUES

--- 25 unchanged lines hidden (view full) ---

133.Xr open 2 ,
134.Xr revoke 2 ,
135.Xr login_tty 3 ,
136.Xr pty 4 ,
137.Xr termios 4 ,
138.Xr group 5
139.Sh BUGS
140The calling process must have an effective UID of super-user in order
136to perform all the intended actions. No notification will occur if
141to perform all the intended actions.
142No notification will occur if
137.Fn openpty
138or
139.Fn forkpty
140failed to proceed with one of the described steps, as long as they could
141at least allocate the pty at all (and create the new process in the case
142of
143.Fn forkpty ) .
143.Fn openpty
144or
145.Fn forkpty
146failed to proceed with one of the described steps, as long as they could
147at least allocate the pty at all (and create the new process in the case
148of
149.Fn forkpty ) .