COHERENT manpages

This page displays the COHERENT manpage for tcgetattr() [Get terminal attributes].

List of available manpages
Index


tcgetattr() -- termios Macro (termios.h)

Get terminal attributes
#include <termios.h>
int tcgetattr (fd, termios_p);
int fd;
struct termios *termios_p;

The termios  macro tcgetattr() gets the parameters  for the terminal device
described by  file descriptor fd, and stores them  in the termios structure
to which termios_p points.

ttcgetattr()  can  be  called  from  a  background process.   Please  note,
however, a foreground process can subsequently change the terminal device's
attributes, which renders obsolete the information in termios_p.

If  all goes  well,  tcgetattr() returns  zero.   If a  problem occurs,  it
returns -1 and sets errno to an appropriate value, as follows:

EBADF
     fd is not a valid file descriptor.

ENOTTY
     fd does not describe a terminal device.

See Also

tcsetattr(),
termios
POSIX Standard, §7.2.1