Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tcgetattr(3) — posix — mips UMIPS RISC/os 4.52

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

termios(7)



TCGETATTR(3-POSIX)  RISC/os Reference Manual   TCGETATTR(3-POSIX)



NAME
     tcgetattr, tcsetattr - get and set terminal state

SYNOPSIS
     #include <termios.h>

     int tcgetattr(fildes, termiosp)
     int fildes;
     struct termios *termiosp;

     int tcsetattr(fildes, optionalactions, termiosp)
     int fildes, optionalactions;
     struct termios *termiop;

DESCRIPTION
     tcgetattr gets the parameters associated with the object
     indicated by fildes and stores them in the termios structure
     referred to by termios_p.  This function may be called from
     a background process; however, the terminal attributes may
     subsequently be changed by a foreground process.

     tcsetattr sets the parameters associated with the terminal
     from the termios structure indicated by termios_p as fol-
     lows:

          1. If optional_actions is TCSANOW, the change occurs
             immediately.

          2. If optional_actions is TCSADRAIN, the change occurs
             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 occurs
             after all output written to fildes has been
             transmitted, and all input that has been received
             but not read is discarded before the change is made.

     The symbolic constants for the values of optional_actions
     are defined in <termios.h>.

RETURN VALUES
     Upon successful completion, 0 is returned.  Otherwise, -1 is
     returned and errno is set to indicate the error.

ERRORS
     If any of the following conditions occur, tcgetattr returns
     -1 and sets errno to the corresponding value:

     [EBADF]             fildes is not a valid file descriptor.

     [ENOTTY]            The file associated with fildes is not a



                         Printed 1/15/91                   Page 1





TCGETATTR(3-POSIX)  RISC/os Reference Manual   TCGETATTR(3-POSIX)



                         terminal.

     If any of the following conditions occur, tcsetattr returns
     -1 and sets errno to the corresponding value:

     [EBADF]             fildes is not a valid file descriptor.

     [EINTR]             A signal interrupted tcsetattr.

     [EINVAL]            optional_actions is invalid, or one of
                         the values in the termios structure
                         indicated by termios_p is an unsupported
                         value.

     [ENOTTY]            The file associated with fildes is not a
                         terminal.

SEE ALSO
     termios(7).




































 Page 2                  Printed 1/15/91



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026