Skip to content

Instantly share code, notes, and snippets.

@paigeruten
Created April 6, 2017 03:18
Show Gist options
  • Save paigeruten/19f1a6df2fed25b0c4bb54dc29ce2572 to your computer and use it in GitHub Desktop.
Save paigeruten/19f1a6df2fed25b0c4bb54dc29ce2572 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
int main() {
int i;
struct termios t;
tcgetattr(STDIN_FILENO, &t);
printf("t.c_iflag = 0x%lx;\n", t.c_iflag);
printf("t.c_oflag = 0x%lx;\n", t.c_oflag);
printf("t.c_cflag = 0x%lx;\n", t.c_cflag);
printf("t.c_lflag = 0x%lx;\n", t.c_lflag);
for (i = 0; i < NCCS; i++) {
printf("t.c_cc[%d] = %u;\n", i, t.c_cc[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment