HP-UX Reference (11i v3 07/02) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
l
ldterm(7) ldterm(7)
NAME
ldterm - standard STREAMS terminal line discipline module
SYNOPSIS
#include <sys/stream.h>
#include <sys/stropts.h>
#include <sys/termios.h>
#include <sys/bsdtty.h>
#include <sys/ttold.h>
#include <sys/strtio.h>
#include <sys/eucioctl.h>
int ioctl( fd, I_PUSH, "ldterm");
DESCRIPTION
ldterm is a STREAMS module that supplies the line discipline for streams-based terminal or pseudo-
terminal device drivers. This module provides most of the functions of the general terminal interface
described in termio (7). However, it does not perform the low-level device control functions specified by the
c_cflag word defined by the POSIX termios structure or the System V termio structure (defined in
termios.h and termio.h, respectively). Also, some operations require the cooperation of the modules
and drivers pushed below the ldterm module in a tty or pty (slave) stream. This man page only covers
ldterm specific interface here and refers to the readers to termio (7) for the detail terminal interface.
Internally, the ldterm module uses the Extended UNIX Code (EUC) character encoding scheme. This
encoding scheme enables the ldterm module to process multibyte characters as well as simple 8-bit char-
acters. It correctly handles backspacing, word erasing, and tab expansion for multibyte EUC characters.
The ldterm module provides standard terminal operation consistent with the behavior specified by POSIX
1003.1 and System V Interface Definition (SVID) Third Edition. It also provides compatibility with the
behavior of the BSD 4.3 line discipline. Notice that on other STREAMS systems, the BSD 4.3 compatibility
feature is usually provided by a separate STREAMS module called
ttcompat. Hence, applications on
HP-UX need not push ttcompat on top of ldterm to get BSD 4.3 compatibility. In fact, the
ttcompat
module is not provided on the HP-UX system at all.
The ldterm module normally sits above either a STREAMS tty driver or a STREAMS pty slave driver.
The user issues an STREAMS I_PUSH ioctl(2) system call to push ldterm onto the stream once the
STREAMS tty or STREAMS pty slave device is opened.
STREAMS Messages
The ldterm module processes various types of STREAMS messages. The line discipline will act on any of
the following message types. Any others that the module receives, however, are passed onto the next
module on the stream.
Read-side Behavior
ldterm processes the following STREAMS messages on its input stream:
M_FLUSH
If FLUSHR is set, the read put routine flushes the read queue, discards characters in the input
message buffers, and discards any partially buffered multibyte EUC characters. Then, it for-
wards the message upstream.
M_BREAK
The read put routine processes the message according to POSIX rules for processing BREAK
events, parity errors, and framing errors and signal generation (see termio(7) for detail). If
there is no data in the message, the message is assumed to represent an input BREAK event,
which is represented by a framing error with a character value of 0 (zero). If there is data in the
message, the data value is an integer that indicates the occurrence of an input BREAK event, or
a character received with a parity or framing error. The low-order 8 bits of the data value is the
byte that was read. If the TTY_PE flag is set in the higher-order bits of this integer, then a par-
ity error was detected. If the TTY_FE flag is set in the higher-order bits of this integer, a fram-
ing error was detected.
After reading the data value, the read put routine discards the message.
M_DATA The read put routine processes the message according to the POSIX 1003.1 specification, using
multibyte processing for backspacing, word erasing, and tab expansion as appropriate.
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 71