Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!gatech!lll-lcc!seismo!uwvax!mcvoy From: mcvoy@uwvax.UUCP Newsgroups: comp.unix.wizards Subject: Tty queues Message-ID: <3293@rsch.WISC.EDU> Date: Sun, 1-Mar-87 15:18:36 EST Article-I.D.: rsch.3293 Posted: Sun Mar 1 15:18:36 1987 Date-Received: Mon, 2-Mar-87 22:55:36 EST Distribution: comp Organization: U of Wisconsin CS Dept Lines: 26 Keywords: Kernel question, ttys, write/read Hi- I work on a system V machine at home sometimes and have a homebrew sysline program hardwired for a h29 terminal. Occassionally the output gets mangled (ie., normal output gets mixed in with the sysline stuff). The call to print the junk on the line looks like printf("%s%80.80s%s", TOSYS, string, TOSCRN); where the manifests are the escape sequences to get to and back from the status line. The tty is running at 19.2K. Well, we were thinking about this and wondering how this works. The naive view (ours) would have it that printf => write (on the whole string) and write copies from user to kernel space, and then sends it to the tty. It's not clear where the stuff gets mixed up. We're guessing that the problem is in printf, that printf makes multiple calls to write() and other stuff gets intermixed between those calls. Is that right? If I made just one call to write with the whole string, would the problem go away? Or is it something like the copy getting interrupted by new tty i/o (I hope not). -- Larry McVoy mcvoy@rsch.wisc.edu, {seismo, topaz, harvard, ihnp4}!uwvax!mcvoy "It's a joke, son! I say, I say, a Joke!!" --Foghorn Leghorn