7
static struct termios term;
9
static void newtermio()
11
struct termios newterm;
14
newterm.c_lflag&=~(ECHO|ICANON);
16
newterm.c_cc[VTIME]=0;
17
tcsetattr(0, TCSANOW, &newterm);
20
static void restoretermio()
22
tcsetattr(0, TCSANOW, &term);
33
if (read(0, &ch, 1) != 1) {
36
printf("%d %x '%c'\n", (int)ch, (int)ch, ch);