xref: /illumos-gate/usr/src/man/man4m/ptem.4m (revision fe73c3d85090a18528209704deee9a7e84f3b5c6)
1'\" te
2.\"  Copyright 1989 AT&T
3.\" Copyright (C) 1999, Sun Microsystems, Inc. All Rights Reserved
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.\" 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.\" 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.\" Copyright 2022 Oxide Computer Company
8.Dd February 5, 2022
9.Dt PTEM 4M
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
25is a STREAMS module that emulates a terminal device when used in conjunction
26with the line discipline,
27.Xr ldterm 4M ,
28and the pseudo terminal driver,
29.Xr ptm 4D .
30.Pp
31The
32.Nm ptem
33module must be pushed
34.Po
35see
36.Dv I_PUSH
37in
38.Xr streamio 4I
39.Pc
40onto the subsidiary device of a pseudo-terminal STREAM, before the
41.Xr ldterm 4M
42module is pushed.
43.Ss Write-side Behaviour
44The
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 ,
56and
57.Dv TIOCSWINSZ
58.Xr termio 4I
59.Xr ioctl 2
60messages are processed and acknowledged.
61.Pp
62If
63.Em remote mode
64is not in effect,
65.Nm ptem
66handles the
67.Dv TIOCSTI
68ioctl by copying the argument bytes into an
69.Dv M_DATA
70message and passing it back up the read side.
71Regardless of the
72.Em remote mode
73setting,
74.Nm ptem
75acknowledges the ioctl and passes a copy of it downstream for possible further
76processing.
77.Pp
78A hang up
79.Po
80e.g.,
81.Ic stty 0
82.Pc
83is converted to a zero length
84.Dv M_DATA
85message and passed downstream.
86.Xr termio 4I
87.Sy cflags
88and window row and column information are stored locally, one per stream.
89.Dv M_DELAY
90messages are discarded.
91.Pp
92All other messages are passed downstream unmodified.
93.Ss Read-side Behaviour
94All messages are passed upstream unmodified with the following exceptions:
95.Bl -bullet
96.It
97All
98.Dv M_READ
99and
100.Dv M_DELAY
101messages are freed in both directions.
102.It
103A
104.Dv TCSBRK
105ioctl is converted to an
106.Dv M_BREAK
107message and passed upstream and an acknowledgement is returned downstream.
108.It
109A
110.Dv TIOCSIGNAL
111ioctl is converted into an
112.Dv M_PCSIG
113message, passed upstream, and an acknowledgement is returned downstream.
114.It
115A
116.Dv TIOCREMOTE
117ioctl is converted into an
118.Dv M_CTL
119message, acknowledged, and passed upstream; the resulting mode is retained for
120use in subsequent
121.Dv TIOCSTI
122parsing.
123.El
124.Sh SEE ALSO
125.Xr stty 1 ,
126.Xr ioctl 2 ,
127.Xr streamio 4I ,
128.Xr termio 4I ,
129.Xr ldterm 4M ,
130.Xr pckt 4M
131