/* * screen(1) filter to simulate the speed of a physical serial terminal */ #include #include #include #include "tsc_usleep.h" #define DEFBAUD 9600 int main(int argc, char **argv) { struct termios tty; int baud, delay; unsigned char c; tcgetattr(STDOUT_FILENO, &tty); cfmakeraw(&tty); tcsetattr(STDOUT_FILENO, TCSANOW, &tty); baud = DEFBAUD; if (argc > 1) baud = atoi(argv[1]); delay = 1000000 / ((double)baud / 10.); while (read(0, &c, 1) > 0) { tsc_usleep(delay); write(1, &c, 1); } return 0; } .