HP-UX Reference (11i v2 04/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

l
ldterm(7) ldterm(7)
Write-side Behavior
ldterm processes the following STREAMS messages on its output stream. Messages not listed here are
simply forwarded downstream.
M_FLUSH The write put routine flushes the write queue and discards any buffered output data. Then, it
forwards the message downstream.
M_DATA The write service routine processes the data according to the POSIX 1003.1 specification out-
put flags. It sends the processed characters downstream to the driver when the output queue
fills up and all of the data is processed.
M_IOCTL The write put routine validates the format of the
M_IOCTL message and checks for known
commands. If the message format is invalid, it turns the
M_IOCTL message into an
M_IOCNAK message, and returns the message upstream. If the I/O control command is not
recognized, it forwards the M_IOCTL message downstream for processing by other modules.
The write put routine determines if the command is one that must be processed in the proper
sequence relative to
M_DATA messages. If so, it queues the
M_IOCTL message to the write
queue for later processing by the write service routine. Commands that require processing in
sequence are:
TCSETSW, TCSETSF, TCSETAW, TCSETAF,
TCSBRK
Otherwise, the module’s write put routine processes the command immediately. Detailed
descriptions of the preceding
ioctl commands are provided in the "ioctl Commands" sub-
section, below.
M_READ This message is sent by the stream head to notify downstream modules when an application
has issued a read request and there is not enough data queued at the stream head to satisfy
the request. The M_READ is sent downstream normally when ldterm is operating in non-
canonical input mode. If VTIME is positive, the write put routine starts an input timer. When
the timer expires, it sends all buffered input upstream. Then, it forwards the M_READ mes-
sage downstream.
ioctl Commands
The
ldterm module acts on two categories of ioctl commands:
Primary terminal I/O control commands
BSD 4.3 compatibility terminal I/O control commands
Detail descriptions on how to use these ioctls can be found on the termio (7) man page. Note: the
FIO[xyz] ioctls documented on termio (7) are currently not supported on ldterm.
Primary Terminal I/O Control Commands
The
ldterm module acts on the following primary terminal I/O commands:
TCSETS, TCSETSW, TCSETSF
When the ldterm module receives any of these commands in an M_IOCTL message, it for-
wards them downstream. When it receives the M_IOCACK message in the read queue, it
copies the POSIX termios information from the message into the internal POSIX termios
structure and forwards the message upstream. If a mode change requires options at the
stream head to be changed, an M_SETOPTS message is sent upstream. If the ICANON flag is
turned on or off, the read mode at the stream head is changed to message-nondiscard (
RMSGN)
with read notification on (
SO_MREADON) or byte-stream mode (RNORM) with read notification
off (SO_MREADOFF), respectively. If the TOSTOP flag is turned on or off, the tostop mode at
the stream head is turned on (SO_TOSTOP)oroff(SO_TONSTOP), respectively.
TCGETS The ldterm module forwards the M_IOCTL message downstream. When it receives the
M_IOCACK message in the read queue, it copies the CLOCAL flags and speeds from the mes-
sage into the internal POSIX termios structure. Then, it copies the entire structure into the
M_IOCACK message and forwards the message upstream.
TCSETA, TCSETAW, TCSETAF
These commands set the old System V termio information. The ldterm module converts
the message to a POSIX termios M_IOCTL message, then forwards the message with a
corresponding POSIX termios command (i.e. TCSETS, TCSETSW, TCSETSF). The original
I/O control command and M_IOCTL message are stored for use on M_IOCACK.
Section 764 Hewlett-Packard Company 3 HP-UX 11i Version 2: September 2004