Technical data

SunOS 5.5 STREAMS Modules ldterm(7M)
NAME ldterm standard STREAMS terminal line discipline module
SYNOPSIS #include <sys/stream.h>
#include <sys/termios.h>
int ioctl( fd, I_PUSH, "ldterm" );
DESCRIPTION ldterm is a STREAMS module that provides most of the termio(7I) terminal interface. This
module does not perform the low-level device control functions specified by flags in the
c_cflag word of the termio/termios structure or by the IGNBRK, IGNPAR, PARMRK,
or INPCK flags in the c_iflag word of the termio/termios structure; those functions must
be performed by the driver or by modules pushed below the ldterm module. ldterm per-
forms all other termio/termios functions; some of them, however, require the cooperation
of the driver or modules pushed below ldterm and may not be performed in some cases.
These include the IXOFF flag in the c_iflag word and the delays specified in the c_oflag
word.
ldterm also handles Extended Unix Code (EUC) and multi-byte characters.
The remainder of this section describes the processing of various STREAMS messages on
the read- and write-side.
Read-side Behavior Various types of STREAMS messages are processed as follows:
M_BREAK
When this message is received, depending on the state of the BRKINT flag, either
an interrupt signal is generated or the message is treated as if it were an
M_DATA message containing a singleASCII NUL character.
M_DATA
This message is normally processed using the standard termio input processing.
If the ICANON flag is set, a single inputrecord (‘‘line’’) is accumulated in an
internal buffer and sent upstream when a line-terminating character is received.
If the ICANON flag is not set, other input processing is performed and the pro-
cessed data are passed upstream.
If output is to be stopped or started as a result of the arrival of characters (usually
CNTRL-Q and CNTRL-S), M_STOP and M_START messages are sent down-
stream. If the IXOFF flag is set and inputis to be stopped or started as a result of
flow-control considerations, M_STOPI and M_STARTI messages are sent
downstream.
M_DATA messages are sent downstream, as necessary, to perform echoing.
If a signal is to be generated,an M_FLUSH message with a flag byte of FLUSHR
is placed on the read queue. If the signal is also to flush output, an M_FLUSH
message with a flag byte of FLUSHW is sent downstream.
M_CTL
If the size of the data buffer associated with the message is the size of struct
iocblk, ldterm will perform functional negotiation to determine where the
modified 3 Jul 1990 7M-183