Tty queues

mcvoy at uwvax.UUCP mcvoy at uwvax.UUCP
Mon Mar 2 06:18:36 AEST 1987


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 at rsch.wisc.edu, 
      		        {seismo, topaz, harvard, ihnp4}!uwvax!mcvoy

"It's a joke, son! I say, I say, a Joke!!"  --Foghorn Leghorn



More information about the Comp.unix.wizards mailing list