#define _POSIX_SOURCE #include main() { int terminal, n; long speed; char buf[512]; do { printf("\nEnter speed: "); scanf("%ld", &speed); terminal = openport("/dev/atc1",speed); printf("Enter text (type to end input):\n"); while ((n = read(0, buf, 512)) > 1) write(terminal, buf, n); close(terminal); } while ( speed != 0 ); terminal = openport("/dev/atc1", 19200); close(terminal); }