Print this page
14249 pseudo-terminal nomenclature should reflect POSIX
Change-Id: Ib4a3cef899ff4c71b09cb0dc6878863c5e8357bc
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man7m/ptem.7m
+++ new/usr/src/man/man7m/ptem.7m
1 1 '\" te
2 2 .\" Copyright 1989 AT&T
3 3 .\" Copyright (C) 1999, Sun Microsystems, Inc. All Rights Reserved
4 4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 -.TH PTEM 7M "Jul 3, 1990"
8 -.SH NAME
9 -ptem \- STREAMS Pseudo Terminal Emulation module
10 -.SH SYNOPSIS
11 -.LP
12 -.nf
13 -\fBint ioctl(\fR\fIfd\fR, \fBI_PUSH\fR,\fB "ptem");\fR
14 -.fi
15 -
16 -.SH DESCRIPTION
17 -.sp
18 -.LP
19 -\fBptem\fR is a STREAMS module that, when used in conjunction with a line
20 -discipline and pseudo terminal driver, emulates a terminal.
21 -.sp
22 -.LP
23 -The \fBptem\fR module must be pushed (see \fBI_PUSH\fR, \fBstreamio\fR(7I))
24 -onto the slave side of a pseudo terminal STREAM, before the \fBldterm\fR(7M)
7 +.\" Copyright 2022 Oxide Computer Company
8 +.Dd February 5, 2022
9 +.Dt PTEM 7M
10 +.Os
11 +.Sh NAME
12 +.Nm ptem
13 +.Nd STREAMS Pseudo-Terminal Emulation module
14 +.Sh SYNOPSIS
15 +.In unistd.h
16 +.In stropts.h
17 +.Ft int
18 +.Fo ioctl
19 +.Fa "int fildes" ,
20 +.Dv I_PUSH ,
21 +.Qq ptem
22 +.Fc
23 +.Sh DESCRIPTION
24 +.Nm ptem
25 +is a STREAMS module that emulates a terminal device when used in conjunction
26 +with the line discipline,
27 +.Xr ldterm 7M ,
28 +and the pseudo terminal driver,
29 +.Xr ptm 7D .
30 +.Pp
31 +The
32 +.Nm ptem
33 +module must be pushed
34 +.Po
35 +see
36 +.Dv I_PUSH
37 +in
38 +.Xr streamio 7I
39 +.Pc
40 +onto the subsidiary device of a pseudo-terminal STREAM, before the
41 +.Xr ldterm 7M
25 42 module is pushed.
26 -.sp
27 -.LP
28 -On the write-side, the \fBTCSETA\fR, \fBTCSETAF\fR, \fBTCSETAW\fR,
29 -\fBTCGETA\fR, \fBTCSETS\fR, \fBTCSETSW\fR, \fBTCSETSF\fR, \fBTCGETS\fR,
30 -\fBTCSBRK\fR, \fBJWINSIZE\fR, \fBTIOCGWINSZ\fR, and \fBTIOCSWINSZ\fR
31 -\fBtermio\fR \fBioctl\fR(2) messages are processed and acknowledged. If remote
32 -mode is not in effect, \fBptem\fR handles the \fBTIOCSTI\fR ioctl by copying
33 -the argument bytes into an \fBM_DATA\fR message and passing it back up the
34 -read side. Regardless of the remote mode setting, \fBptem\fR acknowledges the
35 -ioctl and passes a copy of it downstream for possible further processing. A
36 -hang up (that is, \fBstty 0\fR) is converted to a zero length \fBM_DATA\fR
37 -message and passed downstream. Termio \fBcflags\fR and window row and column
38 -information are stored locally one per stream. \fBM_DELAY\fR messages are
39 -discarded. All other messages are passed downstream unmodified.
40 -.sp
41 -.LP
42 -On the read-side all messages are passed upstream unmodified with the following
43 -exceptions. All \fBM_READ\fR and \fBM_DELAY\fR messages are freed in both
44 -directions. A \fBTCSBRK\fR ioctl is converted to an \fBM_BREAK\fR message and
45 -passed upstream and an acknowledgement is returned downstream. A
46 -\fBTIOCSIGNAL\fR ioctl is converted into an \fBM_PCSIG\fR message, and passed
47 -upstream and an acknowledgement is returned downstream. Finally a
48 -\fBTIOCREMOTE\fR ioctl is converted into an \fBM_CTL\fR message, acknowledged,
49 -and passed upstream; the resulting mode is retained for use in subsequent
50 -\fBTIOCSTI\fR parsing.
51 -.SH FILES
52 -.sp
53 -.ne 2
54 -.na
55 -\fB<\fBsys/ptem.h\fR> \fR
56 -.ad
57 -.RS 17n
58 -
59 -.RE
60 -
61 -.SH SEE ALSO
62 -.sp
63 -.LP
64 -\fBstty\fR(1), \fBioctl\fR(2), \fBldterm\fR(7M), \fBpckt\fR(7M),
65 -\fBstreamio\fR(7I), \fBtermio\fR(7I)
66 -.sp
67 -.LP
68 -\fISTREAMS Programming Guide\fR
43 +.Ss Write-side Behaviour
44 +The
45 +.Dv TCSETA ,
46 +.Dv TCSETAF ,
47 +.Dv TCSETAW ,
48 +.Dv TCGETA ,
49 +.Dv TCSETS ,
50 +.Dv TCSETSW ,
51 +.Dv TCSETSF ,
52 +.Dv TCGETS ,
53 +.Dv TCSBRK ,
54 +.Dv JWINSIZE ,
55 +.Dv TIOCGWINSZ ,
56 +and
57 +.Dv TIOCSWINSZ
58 +.Xr termio 7I
59 +.Xr ioctl 2
60 +messages are processed and acknowledged.
61 +.Pp
62 +If
63 +.Em remote mode
64 +is not in effect,
65 +.Nm ptem
66 +handles the
67 +.Dv TIOCSTI
68 +ioctl by copying the argument bytes into an
69 +.Dv M_DATA
70 +message and passing it back up the read side.
71 +Regardless of the
72 +.Em remote mode
73 +setting,
74 +.Nm ptem
75 +acknowledges the ioctl and passes a copy of it downstream for possible further
76 +processing.
77 +.Pp
78 +A hang up
79 +.Po
80 +e.g.,
81 +.Ic stty 0
82 +.Pc
83 +is converted to a zero length
84 +.Dv M_DATA
85 +message and passed downstream.
86 +.Xr termio 7I
87 +.Sy cflags
88 +and window row and column information are stored locally, one per stream.
89 +.Dv M_DELAY
90 +messages are discarded.
91 +.Pp
92 +All other messages are passed downstream unmodified.
93 +.Ss Read-side Behaviour
94 +All messages are passed upstream unmodified with the following exceptions:
95 +.Bl -bullet
96 +.It
97 +All
98 +.Dv M_READ
99 +and
100 +.Dv M_DELAY
101 +messages are freed in both directions.
102 +.It
103 +A
104 +.Dv TCSBRK
105 +ioctl is converted to an
106 +.Dv M_BREAK
107 +message and passed upstream and an acknowledgement is returned downstream.
108 +.It
109 +A
110 +.Dv TIOCSIGNAL
111 +ioctl is converted into an
112 +.Dv M_PCSIG
113 +message, passed upstream, and an acknowledgement is returned downstream.
114 +.It
115 +A
116 +.Dv TIOCREMOTE
117 +ioctl is converted into an
118 +.Dv M_CTL
119 +message, acknowledged, and passed upstream; the resulting mode is retained for
120 +use in subsequent
121 +.Dv TIOCSTI
122 +parsing.
123 +.El
124 +.Sh SEE ALSO
125 +.Xr stty 1 ,
126 +.Xr ioctl 2 ,
127 +.Xr streamio 7I ,
128 +.Xr termio 7I ,
129 +.Xr ldterm 7M ,
130 +.Xr pckt 7M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX