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