Fix up some libs to work better under linux

This commit is contained in:
K. Lange 2018-09-17 12:58:38 +09:00
parent d1dcc03760
commit c678b6562d
2 changed files with 4 additions and 0 deletions

View File

@ -9,9 +9,12 @@
* complex line editing than what the raw tty interface supplies.
*/
#define _POSIX_C_SOURCE 1
#define _XOPEN_SOURCE 500
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>

View File

@ -1279,6 +1279,7 @@ static void get_initial_termios(void) {
static void set_unbuffered(void) {
struct termios new = old;
new.c_lflag &= (~ICANON & ~ECHO);
new.c_cc[VINTR] = 0;
tcsetattr(STDOUT_FILENO, TCSAFLUSH, &new);
}