1 PTEM(7M)                        STREAMS Modules                       PTEM(7M)
   2 
   3 NAME
   4      ptem - STREAMS Pseudo-Terminal Emulation module
   5 
   6 SYNOPSIS
   7      #include <unistd.h>
   8      #include <stropts.h>
   9 
  10      int
  11      ioctl(int fildes, I_PUSH, "ptem");
  12 
  13 DESCRIPTION
  14      ptem is a STREAMS module that emulates a terminal device when used in
  15      conjunction with the line discipline, ldterm(7M), and the pseudo terminal
  16      driver, ptm(7D).
  17 
  18      The ptem module must be pushed (see I_PUSH in streamio(7I)) onto the
  19      subsidiary device of a pseudo-terminal STREAM, before the ldterm(7M)
  20      module is pushed.
  21 
  22    Write-side Behaviour
  23      The TCSETA, TCSETAF, TCSETAW, TCGETA, TCSETS, TCSETSW, TCSETSF, TCGETS,
  24      TCSBRK, JWINSIZE, TIOCGWINSZ, and TIOCSWINSZ termio(7I) ioctl(2) messages
  25      are processed and acknowledged.
  26 
  27      If remote mode is not in effect, ptem handles the TIOCSTI ioctl by
  28      copying the argument bytes into an M_DATA message and passing it back up
  29      the read side.  Regardless of the remote mode setting, ptem acknowledges
  30      the ioctl and passes a copy of it downstream for possible further
  31      processing.
  32 
  33      A hang up (e.g., stty 0) is converted to a zero length M_DATA message and
  34      passed downstream.  termio(7I) cflags and window row and column
  35      information are stored locally, one per stream.  M_DELAY messages are
  36      discarded.
  37 
  38      All other messages are passed downstream unmodified.
  39 
  40    Read-side Behaviour
  41      All messages are passed upstream unmodified with the following
  42      exceptions:
  43 
  44      o   All M_READ and M_DELAY messages are freed in both directions.
  45 
  46      o   A TCSBRK ioctl is converted to an M_BREAK message and passed upstream
  47          and an acknowledgement is returned downstream.
  48 
  49      o   A TIOCSIGNAL ioctl is converted into an M_PCSIG message, passed
  50          upstream, and an acknowledgement is returned downstream.
  51 
  52      o   A TIOCREMOTE ioctl is converted into an M_CTL message, acknowledged,
  53          and passed upstream; the resulting mode is retained for use in
  54          subsequent TIOCSTI parsing.
  55 
  56 SEE ALSO
  57      stty(1), ioctl(2), streamio(7I), termio(7I), ldterm(7M), pckt(7M)
  58 
  59 illumos                        February 5, 2022                        illumos