summaryrefslogtreecommitdiff
path: root/lib/libc/termios/cfsetospeed.c
blob: 3f46b5c459cbdc7c5a2c7c0291e18b16a7b73662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <errno.h>
#include <asm-generic/termbits.h>

int cfsetospeed(struct termios *termios_p, speed_t speed)
{
	if (speed & ~CBAUD) {
		errno = EINVAL;
		return -1;
	}
	termios_p->c_cflag &= ~CBAUD;
	termios_p->c_cflag |= speed;
	return 0;
}