United States-English |
|
|
HP-UX Reference > Ssttyv6(7)HP-UX 11i Version 3: February 2007 |
|
NAMEsttyv6: stty — terminal interface for Version 6/PWB compatibility DESCRIPTIONThese routines attempt to map the UNIX Time-Sharing System, Sixth Edition (Version 6), and PWB stty() and gtty() calls into the current ioctls that perform the same functions. The mapping cannot be perfect. The way the features are translated is described below. The reader should be familiar with termio before studying this entry. The following data structure is defined in the include file <sgtty.h>: struct sgttyb { char sg_ispeed; /* input speed */ char sg_ospeed; /* output speed */ char sg_erase; /* erase character */ char sg_kill; /* kill character */ int sg_flags; /* mode flags */ } The flags, as defined in sgtty.h, are:
When the stty command (ioctl TIOCSETP) is executed, the flags in the old sgttyb structure are mapped into their new equivalents in the termio structure. Then the TCSETA command is executed. The following table shows the mapping between the old sgttyb flags and the current termio flags. Note that flags contained in the termio structure that are not mentioned below are cleared.
In addition, the termio CREAD bit is set, and, if the baud rate is 110, the CSTOPB bit is set. When using TIOCSETP, the ispeed entry in the sgttyb structure is mapped into the appropriate speed in the termio CBAUD field. The erase and kill sgttyb entries are mapped into the termio erase and kill characters. When the gtty (ioctl TIOCGETP) command is executed, the termio TCGETA command is first executed. The resulting termio structure is then mapped into the sgttyb structure, which is then returned to the user. The following table shows how the termio flags are mapped into the old sgttyb structure. Note that all flags contained in the sgttyb structure that are not mentioned below are cleared.
When using TIOCGETP, the termio CBAUD field is mapped into the ispeed and ospeed entries of the sgttyb structure. Also, the termio erase and kill characters are mapped into the erase and kill sgttyb entries. Note that, since there is not a one-to-one mapping between the sgttyb and termio structures, unexpected results may occur when using the older TIOCSETP and TIOCGETP calls. Thus, the TIOCSETP and TIOCGETP calls should be replaced in all future code by the current equivalents, TCSETA and TCGETA, respectively. WARNINGSThese facilities are included to aid in conversion of old programs, and should not be used in new code. Use the interface described in termio. Note that these conversions do not work for programs ported from UNIX Time-Sharing System, Seventh Edition (Version 7), because some V7 flags are defined differently. |
Printable version | ||
|