Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (t - v) tcgetattr(3)
NAME
tcgetattr - Gets the attributes associated with a terminal
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <termios.h>
int tcgetattr(
int filedes,
struct termios *termios_p);
PARAMETERS
filedes Specifies an open file descriptor associated with a terminal.
termios_p Points to a termios structure.
DESCRIPTION
The tcgetattr( ) function gets the attributes associated with the object referenced by the filedes
parameter and stores them in the termios structure pointed to by the termios_p parameter.
The termios structure can contain baud rate information as follows:
• If the terminal device supports input and output baud rates, then those fields in the ter-
mios structure reflect the actual rate values, even when the rates are equal.
• If the terminal device does not support differing baud rates, the value returned in the out-
put baud rate field is the actual rate value.
• If the device does not support split baud rates, the input baud rate stored in the termios
structure is 0 (zero).
The tcgetattr( ) function can be called from a foreground or background process.
NOTES
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use |
this function with 32-bit or 64-bit OSS applications.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned
and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the tcgetattr( ) function sets errno to the correspond-
ing value:
[EBADF] The filedes parameter is not a valid file descriptor.
[EFAULT] The system detected a bad address while processing a parameter of the function
call.
[EIO] An input/or output error occurred. The device holding the terminal file might be
in the down state, or both processors that provide access to the device might
have failed.
527187-017 Hewlett-Packard Company 7−15