tcsetattr(3) DG/UX 4.30 tcsetattr(3)
NAME
tcgetattr, tcsetattr - Get and set state.
FUNCTIONS
tcgetattr(), tcsetattr()
SYNOPSIS
#include <termios.h>
int tcgetattr (fildes, termios_p)
int fildes;
struct termios *termios_p;
int tcsetattr (fildes, optional_actions, termios_p)
int fildes, optional_actions;
struct termios *termios_p;
DESCRIPTION
The tcgetattr() function shall get the parameters associated
with the object referred to by fildes and store them in the
termios structure referenced by termios_p. This function is
allowed from a background process; however, the terminal
attributes may be subsequently changed by a foreground
process.
The tcsetattr() function shall set the parameters associated
with the terminal (unless support is required from the
underlying hardware that is not available) from the termios
structure referenced by termios_p as follows:
(1) If optional_actions is TCSANOW, the change shall
occur immediately.
(2) If optional_actions is TCSADRAIN, the change shall
occur after all output written to fildes has been
transmitted. This function should be used when
changing parameters that affect output.
(3) If optional_actions is TCSAFLUSH, the change shall
occur after all output written to the object referred
to by fildes has been transmitted, and all input that
has been received but not read shall be discarded
before the change is made.
The symbolic constants for the values of optional_actions
are defined in <termios.h>.
RETURNS
Upon successful completion, a value of zero is returned.
Otherwise, a value of -1 is returned and errno is set to
indicate the error.
Licensed material--property of copyright holder(s) Page 1
tcsetattr(3) DG/UX 4.30 tcsetattr(3)
ERRORS
If any of the following conditions occur, the tcgetattr()
function shall return -1 and set errno to the corresponding
value:
[EBADF]
The fildes argument is not a valid file descriptor.
[ENOTTY]
The file associated with fildes is not a terminal.
If any of the following conditions occur, the tcsetattr()
function shall return -1 and set errno to the corresponding
value:
[EBADF]
The fildes argument is not a valid file descriptor.
[EINVAL]
The optional_actions argument is not a proper value, or
an attempt was made to change an attribute represented
in the termios structure to an unsupported value.
[ENOTTY]
The file associated with fildes is not a terminal.
SEE ALSO
<termios.h>
COPYRIGHTS
Portions of this text are reprinted from IEEE Std 1003.1-
1988, Portable Operating System Interface for Computer
Environment, copyright © 1988 by the Institute of Electrical
and Electronics Engineers, Inc., with the permission of the
IEEE Standards Department. To purchase IEEE Standards, call
800/678-IEEE.
In the event of a discrepancy between the electronic and the
original printed version, the original version takes
precedence.
Licensed material--property of copyright holder(s) Page 2