tcgetattr()

get terminal file descriptor parameters 

Function


SYNOPSIS

#include <termios.h>

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


DESCRIPTION

The tcgetattr() function gets the parameters associated with the specified file descriptor and stores them in the references termios structure. The specified file descriptor must refer to a terminal device. If the terminal device supports different input and output baud rates, the baud rates stored in the termios structure returned by tcgetattr() reflect the actual baud rates, even if they are equal. If differing baud rates are not supported, the rate returned as the output baud rate is the actual baud rate.


PARAMETERS

fildes 

Is the file descriptor, which must refer to a terminal.

termios_p 

Points to a structure where the information is to be returned.


RETURN VALUES

If successful, tcgetattr() returns a value of zero, and fills in the termios structure with the current settings for the device. Otherwise, it returns -1 and sets errno to one of the following values:

EBADF 

The fildes parameter is not a valid file descriptor.

ENOTTY 

The file associated with fildes is not a terminal.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
cfgetispeed(), cfgetospeed(), ioctl(), tcsetattr()

Miscellaneous:
struct termios


PTC MKS Toolkit 10.3 Documentation Build 39.