[comp.unix.xenix.sco] Faking a Control Q from a device

willis@xroads.UUCP (Raymond Willis) (09/07/90)

We have a plotter that I have configured as if it was a printer.  Frequently
the plotter will send a Control S to the computer and for some reason,
never send a Control Q.  When this happens, my only solution has been to
halt and restart the compuer, or hook a CRT in place of the plotter and
hit control Q on the CRT.  Neither solution is acceptable.  Is there a
way to make the system think the plotter has sent a Control Q?
-- 
\  /  C r o s s r o a d s  C o m m u n i c a t i o n s
 /\   (602) 941-2005 300|1200|2400 Baud 24 hrs/day
/  \  hplabs!hp-sdd!crash!xroads!willis

chip@chinacat.Unicom.COM (Chip Rosenthal) (09/08/90)

In article <1120@xroads.UUCP> willis@xroads.UUCP (Raymond Willis) writes:
>Is there a way to make the system think the plotter has sent a Control Q?

If you compile the following as "xon", you could then do, for
example, "xon /dev/tty2a" to unstick tty2a.

--- cut here -----------------------------------------------------------------
#include <stdio.h>
#include <fcntl.h>
#include <termio.h>

main(argc,argv)
int argc;
char *argv[];
{
    int fd;
    if ( argc != 2 ) {
	fprintf(stderr,"usage: %s device\n",argv[0]);
	exit(1);
    }
    if ( (fd=open(argv[1],O_RDONLY)) < 0 ) {
	perror(argv[1]);
	exit(1);
    }
    if ( ioctl(fd,TCXONC,1) != 0 ) {
	perror(argv[1]);
	exit(1);
    }
    close(fd);
    exit(0);
}
--- cut here -----------------------------------------------------------------

-- 
Chip Rosenthal  <chip@chinacat.Unicom.COM>
Unicom Systems Development, 512-482-8260 
Our motto is:  We never say, "But it works with DOS."