Don't flush my queue!

Karl Denninger karl at ddsw1.MCS.COM
Sat Feb 10 04:23:05 AEST 1990


In article <15030008 at hpfijdw.HP.COM> jdw at hpfijdw.HP.COM (Jeff Wood) writes:
>
>If anyone is interested in using smart serial boards and spooled 
>serial printers, take note!  I found out that as soon as the system 
>receives xon signal from the printer, it will flush the port.  When 
>this happens, all requests that were previously in the queue are
>dumped to the port at the same time.
>
>To prevent this from happening, you must hold the port high.
>I accomplished this by adding this line to the file "/etc/rc.d/7/udaemons"
>
>	while :;do sleep 3600;done < /dev/ttya5 &
>
>where /dev/ttya5 is the serial port in question.  This command will
>loop forever and keep the port active.  An explanation of this solution
>is in the latest issue of SCO Discovery magazine.

You can also duplicate the "stty" command at the front of your interface 
script as the last line.

This will have the same effect, and is much cleaner (no leaving processes
around).  We do this with good results under both SCO Xenix and ISC Unix.

The problem is that the port actually is cleared to defaults when closed,
and apparently the close does not wait for output to drain (boo hiss!).  The
scheduler, getting control back after the file has been buffered in the
smart I/O board, closes the port!  Thus, you have the problem.

The "stty" apparently does a "TCSETAW" call to set parameters, and thus does
wait for output to drain.  With a properly designed serial driver, smart or
dumb, this works great.

--
Karl Denninger (karl at ddsw1.MCS.COM, <well-connected>!ddsw1!karl)
Public Access Data Line: [+1 708 566-8911], Voice: [+1 708 566-8910]
Macro Computer Solutions, Inc.		"Quality Solutions at a Fair Price"



More information about the Comp.unix.xenix mailing list