1 #define _BSD_SOURCE 2 #include <termios.h> 3 #include <sys/ioctl.h> 4 #include <errno.h> 5 #include <unsupported_api.h> 6 cfsetospeed(struct termios * tio,speed_t speed)7int cfsetospeed(struct termios *tio, speed_t speed) 8 { 9 unsupported_api(__FUNCTION__); 10 if (speed & ~CBAUD) { 11 errno = EINVAL; 12 return -1; 13 } 14 tio->c_cflag &= ~CBAUD; 15 tio->c_cflag |= speed; 16 return 0; 17 } 18 cfsetispeed(struct termios * tio,speed_t speed)19int cfsetispeed(struct termios *tio, speed_t speed) 20 { 21 unsupported_api(__FUNCTION__); 22 return speed ? cfsetospeed(tio, speed) : 0; 23 } 24 25 weak_alias(cfsetospeed, cfsetspeed); 26