1*bbf21555SRichard Lowe'\" te 2*bbf21555SRichard Lowe.\" Copyright 1989 AT&T 3*bbf21555SRichard Lowe.\" Copyright (C) 1999, Sun Microsystems, Inc. All Rights Reserved 4*bbf21555SRichard Lowe.\" 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*bbf21555SRichard Lowe.\" 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*bbf21555SRichard Lowe.\" 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*bbf21555SRichard Lowe.\" Copyright 2022 Oxide Computer Company 8*bbf21555SRichard Lowe.Dd February 5, 2022 9*bbf21555SRichard Lowe.Dt PTEM 4M 10*bbf21555SRichard Lowe.Os 11*bbf21555SRichard Lowe.Sh NAME 12*bbf21555SRichard Lowe.Nm ptem 13*bbf21555SRichard Lowe.Nd STREAMS Pseudo-Terminal Emulation module 14*bbf21555SRichard Lowe.Sh SYNOPSIS 15*bbf21555SRichard Lowe.In unistd.h 16*bbf21555SRichard Lowe.In stropts.h 17*bbf21555SRichard Lowe.Ft int 18*bbf21555SRichard Lowe.Fo ioctl 19*bbf21555SRichard Lowe.Fa "int fildes" , 20*bbf21555SRichard Lowe.Dv I_PUSH , 21*bbf21555SRichard Lowe.Qq ptem 22*bbf21555SRichard Lowe.Fc 23*bbf21555SRichard Lowe.Sh DESCRIPTION 24*bbf21555SRichard Lowe.Nm ptem 25*bbf21555SRichard Loweis a STREAMS module that emulates a terminal device when used in conjunction 26*bbf21555SRichard Lowewith the line discipline, 27*bbf21555SRichard Lowe.Xr ldterm 4M , 28*bbf21555SRichard Loweand the pseudo terminal driver, 29*bbf21555SRichard Lowe.Xr ptm 4D . 30*bbf21555SRichard Lowe.Pp 31*bbf21555SRichard LoweThe 32*bbf21555SRichard Lowe.Nm ptem 33*bbf21555SRichard Lowemodule must be pushed 34*bbf21555SRichard Lowe.Po 35*bbf21555SRichard Lowesee 36*bbf21555SRichard Lowe.Dv I_PUSH 37*bbf21555SRichard Lowein 38*bbf21555SRichard Lowe.Xr streamio 4I 39*bbf21555SRichard Lowe.Pc 40*bbf21555SRichard Loweonto the subsidiary device of a pseudo-terminal STREAM, before the 41*bbf21555SRichard Lowe.Xr ldterm 4M 42*bbf21555SRichard Lowemodule is pushed. 43*bbf21555SRichard Lowe.Ss Write-side Behaviour 44*bbf21555SRichard LoweThe 45*bbf21555SRichard Lowe.Dv TCSETA , 46*bbf21555SRichard Lowe.Dv TCSETAF , 47*bbf21555SRichard Lowe.Dv TCSETAW , 48*bbf21555SRichard Lowe.Dv TCGETA , 49*bbf21555SRichard Lowe.Dv TCSETS , 50*bbf21555SRichard Lowe.Dv TCSETSW , 51*bbf21555SRichard Lowe.Dv TCSETSF , 52*bbf21555SRichard Lowe.Dv TCGETS , 53*bbf21555SRichard Lowe.Dv TCSBRK , 54*bbf21555SRichard Lowe.Dv JWINSIZE , 55*bbf21555SRichard Lowe.Dv TIOCGWINSZ , 56*bbf21555SRichard Loweand 57*bbf21555SRichard Lowe.Dv TIOCSWINSZ 58*bbf21555SRichard Lowe.Xr termio 4I 59*bbf21555SRichard Lowe.Xr ioctl 2 60*bbf21555SRichard Lowemessages are processed and acknowledged. 61*bbf21555SRichard Lowe.Pp 62*bbf21555SRichard LoweIf 63*bbf21555SRichard Lowe.Em remote mode 64*bbf21555SRichard Loweis not in effect, 65*bbf21555SRichard Lowe.Nm ptem 66*bbf21555SRichard Lowehandles the 67*bbf21555SRichard Lowe.Dv TIOCSTI 68*bbf21555SRichard Loweioctl by copying the argument bytes into an 69*bbf21555SRichard Lowe.Dv M_DATA 70*bbf21555SRichard Lowemessage and passing it back up the read side. 71*bbf21555SRichard LoweRegardless of the 72*bbf21555SRichard Lowe.Em remote mode 73*bbf21555SRichard Lowesetting, 74*bbf21555SRichard Lowe.Nm ptem 75*bbf21555SRichard Loweacknowledges the ioctl and passes a copy of it downstream for possible further 76*bbf21555SRichard Loweprocessing. 77*bbf21555SRichard Lowe.Pp 78*bbf21555SRichard LoweA hang up 79*bbf21555SRichard Lowe.Po 80*bbf21555SRichard Lowee.g., 81*bbf21555SRichard Lowe.Ic stty 0 82*bbf21555SRichard Lowe.Pc 83*bbf21555SRichard Loweis converted to a zero length 84*bbf21555SRichard Lowe.Dv M_DATA 85*bbf21555SRichard Lowemessage and passed downstream. 86*bbf21555SRichard Lowe.Xr termio 4I 87*bbf21555SRichard Lowe.Sy cflags 88*bbf21555SRichard Loweand window row and column information are stored locally, one per stream. 89*bbf21555SRichard Lowe.Dv M_DELAY 90*bbf21555SRichard Lowemessages are discarded. 91*bbf21555SRichard Lowe.Pp 92*bbf21555SRichard LoweAll other messages are passed downstream unmodified. 93*bbf21555SRichard Lowe.Ss Read-side Behaviour 94*bbf21555SRichard LoweAll messages are passed upstream unmodified with the following exceptions: 95*bbf21555SRichard Lowe.Bl -bullet 96*bbf21555SRichard Lowe.It 97*bbf21555SRichard LoweAll 98*bbf21555SRichard Lowe.Dv M_READ 99*bbf21555SRichard Loweand 100*bbf21555SRichard Lowe.Dv M_DELAY 101*bbf21555SRichard Lowemessages are freed in both directions. 102*bbf21555SRichard Lowe.It 103*bbf21555SRichard LoweA 104*bbf21555SRichard Lowe.Dv TCSBRK 105*bbf21555SRichard Loweioctl is converted to an 106*bbf21555SRichard Lowe.Dv M_BREAK 107*bbf21555SRichard Lowemessage and passed upstream and an acknowledgement is returned downstream. 108*bbf21555SRichard Lowe.It 109*bbf21555SRichard LoweA 110*bbf21555SRichard Lowe.Dv TIOCSIGNAL 111*bbf21555SRichard Loweioctl is converted into an 112*bbf21555SRichard Lowe.Dv M_PCSIG 113*bbf21555SRichard Lowemessage, passed upstream, and an acknowledgement is returned downstream. 114*bbf21555SRichard Lowe.It 115*bbf21555SRichard LoweA 116*bbf21555SRichard Lowe.Dv TIOCREMOTE 117*bbf21555SRichard Loweioctl is converted into an 118*bbf21555SRichard Lowe.Dv M_CTL 119*bbf21555SRichard Lowemessage, acknowledged, and passed upstream; the resulting mode is retained for 120*bbf21555SRichard Loweuse in subsequent 121*bbf21555SRichard Lowe.Dv TIOCSTI 122*bbf21555SRichard Loweparsing. 123*bbf21555SRichard Lowe.El 124*bbf21555SRichard Lowe.Sh SEE ALSO 125*bbf21555SRichard Lowe.Xr stty 1 , 126*bbf21555SRichard Lowe.Xr ioctl 2 , 127*bbf21555SRichard Lowe.Xr streamio 4I , 128*bbf21555SRichard Lowe.Xr termio 4I , 129*bbf21555SRichard Lowe.Xr ldterm 4M , 130*bbf21555SRichard Lowe.Xr pckt 4M 131