Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tcgetattr(3c) [sunos man page]

tcgetattr(3C)						   Standard C Library Functions 					     tcgetattr(3C)

NAME
tcgetattr - get the parameters associated with the terminal SYNOPSIS
#include <termios.h> int tcgetattr(int fildes, struct termios *termios_p); DESCRIPTION
The tcgetattr() function gets the parameters associated with the terminal referred to by fildes and stores them in the termios structure (see termio(7I)) referenced by termios_p. The fildes argument is an open file descriptor associated with a terminal. The termios_p argument is a pointer to a termios structure. The tcgetattr() operation is allowed from any process. If the terminal device supports different input and output baud rates, the baud rates stored in the termios structure returned by tcge- tattr() 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. If the terminal device does not support split baud rates, the input baud rate stored in the termios structure will be 0. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The tcgetattr() function will fail if: EBADF The fildes argument is not a valid file descriptor. ENOTTY The file associated with fildes is not a terminal. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-------------------------------+ |Interface Stability |Standard | +-----------------------------+-------------------------------+ |MT-Level |MT-Safe, and Async-Signal-Safe | +-----------------------------+-------------------------------+ SEE ALSO
tcsetattr(3C), attributes(5), standards(5), termio(7I) SunOS 5.10 14 Aug 2002 tcgetattr(3C)

Check Out this Related Man Page

tcattribute(3C) 														   tcattribute(3C)

NAME
tcgetattr(), tcsetattr() - control tty device SYNOPSIS
DESCRIPTION
gets the parameters associated with fildes and stores them in the termios structure referenced by termios_p. If the terminal device does not support split baud rates, the input baud rate stored in the termios structure is zero. This function is allowed from a background process (see termio(7)). However, the terminal attributes can be subsequently changed by a foreground process. sets the parameters associated with fildes (unless support is required from underlying hardware that is not available) from the termios structure referenced by termios_p as follows: o If optional_actions is the change is immediate. o If optional_actions is the change occurs after all output written to fildes is transmitted. o If optional_actions is the change occurs after all output written to fildes is transmitted, and all input that has been received but not read is discarded. RETURN VALUE
Upon successful completion, a value of zero is returned. Otherwise, a value of -1 is returned and is set to indicate the error. ERRORS
and fail if any of the following conditions are encountered: [EBADF] fildes is not a valid file descriptor. [EINVAL] The optional_actions argument is not a proper value or no part of a request could be performed. [ENOTTY] The file associated with fildes is not a terminal. WARNINGS
will attempt to perform as much of the request as possible. However, the hardware being used may not support all possible c_cflag values. If any part of the request can be performed, those values will be set, any values not supported by the hardware will be ignored, and will complete successfully. If no part of the request can be performed, will fail and set to [EINVAL]. For any hardware that does not support separate input and output baud rates, an attempt to set different input and output baud rates does not affect either baud rate. always returns the actual values set in hardware. For any hardware that does not support separate input and output baud rates, returns zero for the input baud rate. SEE ALSO
cfspeed(3C), tccontrol(3C), thread_safety(5), termio(7). STANDARDS CONFORMANCE
tcattribute(3C)
Man Page