1119610Sache#define _GNU_SOURCE
2119610Sache#include <termios.h>
3157184Sache
4119610Sachevoid cfmakeraw(struct termios* t) {
5119610Sache    t->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
6119610Sache    t->c_oflag &= ~OPOST;
7119610Sache    t->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
8119610Sache    t->c_cflag &= ~(CSIZE | PARENB);
9119610Sache    t->c_cflag |= CS8;
10119610Sache    t->c_cc[VMIN] = 1;
11119610Sache    t->c_cc[VTIME] = 0;
12119610Sache}
13119610Sache