#include <termios.h> speed_t cfgetispeed(const struct termios *termios_p); speed_t cfgetospeed(const struct termios *termios_p); int cfsetispeed(struct termios *termios_p, speed_t speed); int cfsetospeed(struct termios *termios_p, speed_t speed);
These interfaces are used for getting and setting the values of the input and output baud rates in the termios structure. The effects on the terminal device do not become effective until the tcsetattr function is successfully called.
The cfgetispeed function returns the input baud rate stored in the termios structure to which termios_p points.
The cfgetospeed function returns the output baud rate stored in the termios structure to which termios_p points.
The cfsetispeed function sets the input baud rate stored in the termios structure to which termios_p points.
The cfsetospeed function sets the output baud rate stored in the termios structure to which termios_p points.
The cfsetispeed and cfsetospeed functions return a value of zero if successful and -1 otherwise.