HP-UX Reference (11i v2 07/12) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
t
termio(7) termio(7)
termios Structure Functions
Function Description
cfgetospeed() get output baud rate
cfgetispeed() get input baud rate
cfsetospeed() set output baud rate
cfsetispeed() set input baud rate
tcgetattr() get terminal state
tcsetattr() set terminal state
termio Structure-Related OCTL Commands
Several ioctl() system calls apply to terminal files that use the
termio structure (see termio Struc-
ture). If a requested command is not recognized, the request returns
-1 with errno set to [EINVAL].
ioctl() system calls that reference the termio
structure have the form:
ioctl (fildes, command, arg)
struct termio *arg;
Commands using this form are:
TCGETA Get the parameters associated with the terminal and store them in the termio
structure referenced by arg. This command is allowed from a background process;
however, the information may be subsequently changed by a foreground process.
TCSETA Set the parameters associated with the terminal from the termio structure refer-
enced by arg. The change is immediate. If characters are being output when the
command is requested, results are undefined and the output may be garbled.
TCSETAW Wait for the output to drain before setting new parameters. This form should be used
when changing parameters that affect output.
TCSETAF Wait for the output to drain, then flush the input queue and set the new parameters.
termio Caveats
Only the first eight special control characters (see termios Structure) can be set or returned. The values of
indices VEOL and VEOF are the same as indices VTIME and VMIN respectively. Hence if
ICANON is set,
VEOL or VTIME is the additional end-of-line character and VEOF or VMIN is the end-of-file character. If
ICANON is clear, VEOL or VTIME is the inter-character-timer value and VEOF or VMIN is the minimum
number of characters desired for reads.
Structure-Independent Functions
The following functions which are independent of both the termio and termios structures are pro-
vided for controlling terminals. Refer to the appropriate manual entries for details.
Structure-Independent Functions
Function Description
tcsendbreak() send a break
tcdrain() wait until output has drained
tcflush() flush input or output queue or both
tcflow() suspend or resume input or output
tcgetpgrp() get foreground process group id
tcsetpgrp() set foreground process group id
tcgetsid() get session id
System Asynchronous I/O IOCTL Commands
The following ioctl() system calls provide for system asynchronous I/O and have the form:
ioctl (fildes, command, arg)
int *arg;
Commands using this form are:
FIOSSAIOSTAT If the integer referenced by arg is non-zero, system asynchronous I/O is enabled;
that is, enable SIGIO to be sent to the process currently designated with
FIOSSAIOOWN (see below) whenever the terminal device file status changes
from "no read data available" to "read data available". If no process has been
designated with FIOSSAIOOWN , enable SIGIO to be sent to the first process
that opened the terminal device file.
204 Hewlett-Packard Company − 13 − HP-UX 11i Version 2: December 2007 Update