#include #include static struct termio tbufsave; int main(int argc, char *argv) { char c; struct termio tbuf; if ( ioctl(0, TCGETA, &tbuf) == -1) perror( "TCGETA" ); tbufsave = tbuf; tbuf.c_iflag &= ~( INLCR | ICRNL | IUCLC | ISTRIP | IXON | BRKINT ); tbuf.c_oflag &= ~OPOST; tbuf.c_lflag &= ~( ICANON | ISIG | ECHO ); tbuf.c_cc[4] = 0; tbuf.c_cc[5] = 9999; if ( ioctl(0,TCSETAF, &tbuf ) == -1 ) perror("TCSETAF"); c=getchar(); if( ioctl( 0, TCSETAF,&tbufsave) == -1) perror( "ioctl" ); printf("\"%c\"",c); return(0); }