|
|
HP-UX Reference Volume 4 of 5 > ttcattribute(3C) |
|
NAMEtcgetattr(), tcsetattr() — control tty device SYNOPSIS#include <termios.h> int tcgetattr(int fildes, struct termios *termios_p); int tcsetattr( int fildes, int optional_actions, const struct termios *termios_p ); DESCRIPTIONtcgetattr() 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. tcsetattr() 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:
RETURN VALUEUpon successful completion, a value of zero is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORStcgetattr() and tcsetattr() fail if any of the following conditions are encountered:
WARNINGStcsetattr() 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 tcsetattr() will complete successfully. If no part of the request can be performed, tcsetattr() will fail and set errno 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. tcgetattr() always returns the actual values set in hardware. For any hardware that does not support separate input and output baud rates, tcgetattr() returns zero for the input baud rate. |
|