while( input == 0 ) { fcntl(0, F_SETFL, flags | O_NONBLOCK); ioctl(0, TCGETA, &savetty); ioctl(0, TCGETA, &settty); settty.c_lflag &= ~ICANON; settty.c_lflag &= ~ECHO; ioctl(0, TCSETAF, &settty); ch = getc(stdin); switch(ch) {