termio.7 (2010 09)

t
termio(7) termio(7)
the process to its controlling terminal may be denied (see Terminal Access Control ).
Terminal Size IOCTL Commands
The following
ioctl() system calls are used to get and set terminal size information for the terminal
referenced by fildes . These ioctl() system calls use the
winsize structure to get and set the termi-
nal size information. The
winsize structure, defined in
<termios.h>, has the following members :
unsigned short ws_row; /* Rows, in characters */
unsigned short ws_col; /* Columns, in characters */
unsigned short ws_xpixel; /* Horizontal size, in pixels */
unsigned short ws_ypixel; /* Vertical size, in pixels */
The initial values for all elements of terminal size are zero. The values for terminal size are neither set
nor used by the general terminal interface, and have no effect on the functionality of the general terminal
interface. The values for terminal size are set and used only by applications that access them through the
terminal-size
ioctl() system calls (see ioctl (2)).
ioctl() system calls that use the above structure have the form:
ioctl (fildes, command, arg)
struct winsize *arg;
Commands using this form are:
TIOCGWINSZ Get the terminal size values and store them in the winsize structure referenced
by arg. This command is allowed from a background process.
TIOCSWINSZ Set the terminal size values from the winsize structure referenced by arg. If any
of the new values differ from previous values, a SIGWINCH signal is sent to all
processes in the terminal’s foreground process group.
Console Output Redirection IOCTL Command
Output which would normally be sent to the system console may be redirected to any other TTY device or
pseudo-device in the system. The
ioctl() system call used to control console output redirection has
the form:
ioctl (fildes, command, arg)
int arg;
The command using this form is:
TIOCCONS Redirect system console output. Any output that would normally be sent to the sys-
tem console, either through kernel printf requests, or through the console special
file, will instead be sent to the terminal referenced by fildes . The value of arg is
ignored. The user must have the
DEVOPS privilege to execute this request. Other-
wise, the call returns 1 with errno set to [EPERM]. If the console output has not
been redirected to a different device by a later call to this command, it is redirected
back to the physical console device when fildes is closed.
WARNINGS
Various HP-UX implementations use non-serial interfaces that look like terminals (such as bit-mapped
graphics displays) or ‘‘smart cards’’ that cannot implement the exact capabilities described above. There-
fore, not all systems can exactly meet the standard stated above. Each implementation is required to
state any deviations from the standard as part of its system-specific documentation.
FIOSSAIOSTAT is similar to BSD 4.2 FIOASYNC, with the addition of provisions for security.
FIOGSAIOSTAT is of HP origin, complements FIOSSAIOSTAT, and allows saving and restor-
ing system asynchronous I/O TTY states for command interpreter processes.
FIOSSAIOOWN is similar to BSD 4.2 FIOSETOWN, with additional provisions for security.
FIOGSAIOOWN is similar to BSD FIOGETOWN. 4.2 Note also the difference that the BSD 4.2
version of this functionality used process groups, while the HP-UX version
only uses processes.
FIOSNBIO is the same as BSD FIONBIO, 4.2 except that it does not interfere with the
O_NDELAY or O_NONBLOCK open() and fcntl() flags.
FIOGNBIO is of HP origin, complements FIOSNBIO, and allows saving and restoring the
FIOSNBIO-style non-blocking I/O TTY state for command interpreter
18 Hewlett-Packard Company 18 HP-UX 11i Version 3: September 2010