Technical data
termio(7I) Ioctl Requests SunOS 5.5
NAME termio − general terminal interface
SYNOPSIS #include <termio.h>
ioctl(int fildes, int request, struct termio ∗arg);
ioctl(int fildes, int request, int arg);
#include <termios.h>
ioctl(int fildes, int request, struct termios ∗arg);
DESCRIPTION This release supports a general interface for asynchronous communications ports that is
hardware-independent. The user interface to this functionalityis using function calls (the
preferred interface) described in termios(3) or ioctl commands described in this section.
This section also discusses the common features of the terminal subsystem which are
relevant with both user interfaces.
When a terminal file is opened, it normally causes the process to wait until a connection
is established. In practice, users’ programs seldom open terminal files; they are opened
by the system and become a user’s standard input, output, and error files. The first ter-
minal file opened by the session leader that is not already associated with a session
becomes the controlling terminal for that session. The controlling terminal plays a special
role in handlingquit and interrupt signals, as discussed below. The controlling terminal
is inherited by a child process during a fork(2). A process can break this association by
changing its session using setsid() (see getsid(2)).
A terminal associated with one of these files ordinarily operates in full-duplex mode.
Characters may be typed at any time, even while output is occurring, and are only lost
when the character input buffers of the system become completely full, which is rare (for
example, if the number of characters in the line discipline buffer exceeds
{MAX_CANON} and IMAXBEL (see below) is not set), or when the user has accumu-
lated {MAX_INPUT} number of input characters that have not yet been read by some
program. When the input limit is reached, all the characters saved in the buffer up to that
point are thrown away without notice.
Session management
(Job Control)
A control terminal will distinguishone of the process groups in the session associated
with it to be the foreground process group. All other process groups in the session are
designated as background process groups. This foreground process group plays a spe-
cial role in handling signal-generating input characters, as discussed below. By default,
when a controlling terminal is allocated, the controlling process’s process group is
assigned as foreground process group.
Background process groups in the controlling process’s session are subject to a job con-
trol line discipline when they attempt to access their controlling terminal. Process groups
can be sent signals that will cause them to stop, unless theyhave made other arrange-
ments. An exception is made for members of orphaned process groups.
7I-346 modified 30 May 1995










