Technical data

ttcompat(7M) STREAMS Modules SunOS 5.5
NAME ttcompat V7, 4BSD and XENIX STREAMS compatibility module
SYNOPSIS #include <sys/stream.h>
#include <sys/stropts.h>
#include <sys/ttold.h>
#include <sys/ttcompat.h>
#include <sys/filio.h>
ioctl( fd, I_PUSH, "ttcompat");
DESCRIPTION ttcompat is a STREAMS module that translates the ioctl calls supported by the olderVer-
sion 7, 4BSD,
and XENIX terminal drivers into the ioctl calls supported by the termio
interface (see termio(7I)). All other messages pass through this module unchanged; the
behavior of read and write calls is unchanged, as is the behavior of ioctl calls other than
the ones supported by ttcompat.
This module can be automatically pushed onto a stream using the autopush mechanism
when a terminal device is opened; it does not have to be explicitlypushed onto a stream.
This module requires that the termios interface be supported by the modules and the
application can push the driver downstream. The TCGETS, TCSETS, andTCSETSF ioctl
calls must be supported. If any information set or fetched by those ioctl calls is not sup-
ported by the modules and driver downstream, some of the V7/4BSD/XENIX functions
may not be supported. For example, if the CBAUD bits in the c_cflag field are not sup-
ported, the functions provided by the sg_ispeed and sg_ospeed fields of the sgttyb struc-
ture (see below) will not be supported. If the TCFLSH ioctl is not supported, the function
provided by theTIOCFLUSH ioctl will not be supported. If the TCXONC ioctl is not sup-
ported, the functions provided by theTIOCSTOP and TIOCSTART ioctl calls will not be
supported. If the TIOCMBIS andTIOCMBIC ioctl calls are not supported, the functions
provided by theTIOCSDTR and TIOCCDTR ioctl calls will not be supported.
The basic ioctl calls use the sgttyb structure defined by <sys/ttold.h>:
struct sgttyb {
char sg_ispeed;
char sg_ospeed;
char sg_erase;
char sg_kill;
int sg_flags;
};
The sg_ispeed and sg_ospeed fields describe the input and output speeds of the device,
and reflect the values in the c_cflag field of the termios structure. The sg_erase and
sg_kill fields of the argument structure specify the erase and kill characters respectively,
and reflect the values in the VERASE and VKILL members of the c_cc field of the termios
structure.
The sg_flags field of the argument structure contains several flags that determine the
system’s treatment of the terminal. They are mapped into flags in fields of the terminal
state, represented by the termios structure.
7M-384 modified 2 Jun 1995