1ptem(7M) STREAMS Modules ptem(7M)
2
3
4
6 ptem - STREAMS Pseudo Terminal Emulation module
7
9 int ioctl(fd, I_PUSH, "ptem");
10
11
13 ptem is a STREAMS module that, when used in conjunction with a line
14 discipline and pseudo terminal driver, emulates a terminal.
15
16
17 The ptem module must be pushed (see I_PUSH, streamio(7I)) onto the
18 slave side of a pseudo terminal STREAM, before the ldterm(7M) module is
19 pushed.
20
21
22 On the write-side, the TCSETA, TCSETAF, TCSETAW, TCGETA, TCSETS,
23 TCSETSW, TCSETSF, TCGETS, TCSBRK, JWINSIZE, TIOCGWINSZ, and TIOCSWINSZ
24 termio ioctl(2) messages are processed and acknowledged. If remote mode
25 is not in effect, ptem handles the TIOCSTI ioctl by copying the argu‐
26 ment bytes into an M_DATA message and passing it back up the read
27 side. Regardless of the remote mode setting, ptem acknowledges the
28 ioctl and passes a copy of it downstream for possible further process‐
29 ing. A hang up (that is, stty 0) is converted to a zero length M_DATA
30 message and passed downstream. Termio cflags and window row and column
31 information are stored locally one per stream. M_DELAY messages are
32 discarded. All other messages are passed downstream unmodified.
33
34
35 On the read-side all messages are passed upstream unmodified with the
36 following exceptions. All M_READ and M_DELAY messages are freed in both
37 directions. A TCSBRK ioctl is converted to an M_BREAK message and
38 passed upstream and an acknowledgement is returned downstream. A
39 TIOCSIGNAL ioctl is converted into an M_PCSIG message, and passed
40 upstream and an acknowledgement is returned downstream. Finally a
41 TIOCREMOTE ioctl is converted into an M_CTL message, acknowledged, and
42 passed upstream; the resulting mode is retained for use in subsequent
43 TIOCSTI parsing.
44
46 <sys/ptem.h>
47
48
50 stty(1), ioctl(2), ldterm(7M), pckt(7M), streamio(7I), termio(7I)
51
52
53 STREAMS Programming Guide
54
55
56
57SunOS 5.11 3 Jul 1990 ptem(7M)