Beispiel #1
0
int main( void )
{
  struct termios ttyinfo;

  if( tcgetattr( 0, &ttyinfo ) == -1 ) {
    perror( "cannot get params about stdin " );
    exit( 1 );
  }

  showbaud( cfgetospeed( &ttyinfo ) );
  printf( "The erase character is ascii %d, Ctrl-%c\n",
	  ttyinfo.c_cc[VERASE], ttyinfo.c_cc[VERASE] - 1 + 'A' );
  printf( "The line kill character is ascii %d, Ctrl-%c\n",
	  ttyinfo.c_cc[VKILL], ttyinfo.c_cc[VKILL] - 1 + 'A' );
  show_some_flags( &ttyinfo );

  return 0;
}
Beispiel #2
0
int main(int argc, char* argv[])
{
  struct termios ttyinfo;
  if (tcgetattr(0,&ttyinfo) == -1)
  {
    perror ("tcgetattr");
    exit(1);
  }

  showbaud(cfgetospeed(&ttyinfo));

  printf ("The erase character is ASCII %d, Ctrl-%c\n",
            ttyinfo.c_cc[VERASE],
            ttyinfo.c_cc[VERASE]-1+'A');

  printf ("The line kill character is ASCII %d, Ctrl-%c\n",
            ttyinfo.c_cc[VKILL],
            ttyinfo.c_cc[VKILL]-1+'A');

  show_some_flags(&ttyinfo);
}