1 #define _NO_MACROS 2 #include <sys/termios.h> 3 4 speed_t cfgetospeed(const struct termios * tp)5cfgetospeed(const struct termios *tp) { 6 return tp->c_ospeed; 7 } 8 9 int cfsetospeed(struct termios * tp,speed_t speed)10cfsetospeed(struct termios *tp, speed_t speed) { 11 tp->c_ospeed = speed; 12 return 0; 13 } 14 15 speed_t cfgetispeed(const struct termios * tp)16cfgetispeed(const struct termios *tp) { 17 return tp->c_ispeed; 18 } 19 20 int cfsetispeed(struct termios * tp,speed_t speed)21cfsetispeed(struct termios *tp, speed_t speed) { 22 tp->c_ispeed = speed; 23 return 0; 24 } 25