Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbjade.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!ittatc!dcdwest!sdcsvax!ucbvax!ucbjade!ucbtopaz!cnrdean From: cnrdean@ucbtopaz.BERKELEY.EDU Newsgroups: net.unix-wizards Subject: cbreak problem Message-ID: <299@ucbjade.BERKELEY.EDU> Date: Wed, 5-Feb-86 17:26:39 EST Article-I.D.: ucbjade.299 Posted: Wed Feb 5 17:26:39 1986 Date-Received: Sun, 9-Feb-86 04:31:44 EST Sender: network@ucbjade.BERKELEY.EDU Reply-To: cnrdean@ucbtopaz.BERKELEY.EDU () Organization: University of California, Berkeley Lines: 27 I am porting a program on to a Berkeley 4.2 Vax, and I'm having trouble with my cbreak mode: I need to process characters as they come in. My problem is that when I try to print the characters, they don't get printed at the point that I request them to, unless I put a fflush in. I thought that when I was in cbreak mode, putchar() would show up immediately, without fflushing. Can you help? I've read TTY(4), and tried fooling with some of the flushing mechanisms in there, to no avail. Following is an example of my code: #include . . . char c; struct sgttyb cbrmode, /* Controlling tty cbreak mode */ cookedmode; /* Controlling tty cooked mode */ . . . gtty(0,&cbrmode); cbrmode.sg_flags |= (CBREAK); cbrmode.sg_flags &= ~(ECHO|XTABS|CRMOD); stty(0,&cbrmode); /* Put tty in cbreak mode */ . . . read(0,&c,1); /* Get a character */ c = c & 0177; putchar(c);