[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs

TTY Revision History

This section is intended for people familiar with the AIX Version 3 tty subsystem. It provides information about the changes that occurred between Version 3 and AIX Version 4 of the operating system, and compatibility issues.

Read the following to learn more about tty revision history:

TTY Structure

The tty subsystem structure completely changed, as shown in the following figure. In AIX Version 3, the tty subsystem was made up of stacked disciplines: a hardware discipline, control disciplines, and line disciplines. At the top of the stack, the tty common code provided a generic interface for applications. In AIX Version 4, the tty subsystem uses the standard STREAMS structure, as described in TTY Subsystem Structure.

The features of each part of the tty subsystem changed. In AIX Version 3, the tty common code handled the different line disciplines. In AIX Version 4, the ldterm line discipline replaces the previous line disciplines of Version 3. The nls converter module replaces the mapping control disciplines. The non-EUC multibyte codes are handled by separate converter modules. The open and pacing control disciplines are integrated in the tty drivers.

Because the AIX Version 4 tty subsystem uses the standard STREAMS structure, programming a tty module consists in programming a STREAMS module.

Unsupported ioctl Operations

Some ioctl operations are no longer supported. The following list provides replacement strategies for each of them.

TCSCSMAP csmap structure is not used in AIX Version 4. The setcsmap subroutine must be used to change the code set map file.
TXADDCD
TXDELCD
TXGETCD
TXGETLD
TXSETLD Handle line and control disciplines. Due to the structure changes, the line and control discipline handling is no longer required. The tty modules are automatically handled by the tty subsystem, using the STREAMS operations such as I_LIST, I_PUSH, and I_POP.
TXSBAUD Gets and sets baud rates. Use the cfgetospeed, cfsetospeed, cfgetispeed, and cfsetispeed subroutines to get and set input and output baud rates.

Supported ioctl Operations

Most of the ioctl operations used in the previous versions of the operating system were maintained for compatibility reasons. When programming a new application, or when changing an old one, it is however preferable to use the tty subroutines.

The following list indicates ioctl operations still supported by the tty subsystem and their corresponding tty subroutines.

TIOCGPGRP Gets the process group. The argument to this command is a pointer to a pid_t field. On return, the pid_t field is set to the process group ID of the foreground process group associated with the terminal.

This operation is also performed by the tcgetpgrp subroutine.

TIOCSPGRP Sets the process group. The argument is a pointer to a pid_t field. The process group whose ID is specified by the pid_t field must be associated with the terminal. The process group must be in the same session as the process issuing this command. If not, an EPERM error is returned.

This operation is also performed by the tcsetpgrp subroutine.

TXISATTY The TXISATTY ioctl operation returns a value of -1 and sets the errno global variable to ENOTTY if the object referred to by the FileDescriptor parameter is not a terminal device. If the parameter does specify a terminal device, a value of 0 is returned.

The TXISATTY ioctl operation has the following format:

ioctl(FileDescriptor, TXISATTY, 0)

This operation is also performed by the isatty subroutine.

TXTTYNAME The TXTTYNAME ioctl operation returns the object name of the terminal device referred to by the FileDescriptor parameter. The object name is defined in the Object Data Manager (ODM).

The TXTTYNAME ioctl operation has the following format:

ioctl(FileDescriptor, TXTTYNAME, Buffer)

This operation is also performed by the ttyname subroutine.

Related Information

TTY Subsystem Overview.

Line Discipline Module (ldterm).

Understanding TTY Drivers.

The ioctl subroutine.

The temios.h file, termiox.h file.


[ Previous | Next | Contents | Glossary | Home | Search ]