diff --git a/c/os_sunos.c b/c/os_sunos.c index d97a384..29ede45 100644 --- a/c/os_sunos.c +++ b/c/os_sunos.c @@ -1,3 +1,5 @@ +#include + #include #include #include @@ -14,3 +16,15 @@ char *get_exename(char *buf, size_t size) (void)size; return NULL; } + +void cfmakeraw(struct termios *t) +{ + t->c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | + IGNCR | ICRNL | IXON); + t->c_oflag &= ~OPOST; + t->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + t->c_cflag &= ~(CSIZE | PARENB); + t->c_cflag |= CS8; + t->c_cc[VMIN] = 1; + t->c_cc[VTIME] = 0; +} diff --git a/c/os_unix.c b/c/os_unix.c index 9a4d0b8..6354ee2 100644 --- a/c/os_unix.c +++ b/c/os_unix.c @@ -218,6 +218,8 @@ static void relocate_dir(value_t oldv, value_t newv) static struct termios term_mode_orig; static struct termios term_mode_raw; +void cfmakeraw(struct termios *t); + static void term_mode_init(void) { static int done;