summaryrefslogtreecommitdiff
path: root/src/termios/tcsetattr.c
blob: e9a168f39233773588363e2ecf57342c051221c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <termios.h>
#include <sys/ioctl.h>
#include <string.h>
#include <errno.h>

int tcsetattr(int fd, int act, const struct termios *tio)
{
	if (act < 0 || act > 2) {
		errno = EINVAL;
		return -1;
	}
	return ioctl(fd, TCSETS+act, tio);
}