Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxj!mhuxr!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!tgr!fgd@cit-vax
From: fgd@cit-vax (Test Account -- Arpa(MON))
Newsgroups: net.sources
Subject: blast
Message-ID: <6854@brl-tgr.ARPA>
Date: Sun, 30-Dec-84 23:40:26 EST
Article-I.D.: brl-tgr.6854
Posted: Sun Dec 30 23:40:26 1984
Date-Received: Tue, 1-Jan-85 00:54:48 EST
Sender: news@brl-tgr.ARPA
Organization: Ballistic Research Lab
Lines: 50


	This program, though short, turns out useful every now and then.
You may want to add echoing on the remote terminal.  Also,  apologies to
non-BSD people.  I havent yet tried it under Amdahl's UTS....

					-- mike

--------------------------------------------------------------------------
/* Blast into a users terminal.  Great fun, and sometimes useful. */

/* December 1984 */
/* Pasadena CA -- Mike Newton, Caltech 256-80, Pasadena, CA 91125 */

/* newton@cit-vax.ARPA */
/* newton%cit-vax.CSNET */
/* {ucbvax,allegra}!cithep!cit-vax!newton.UUCP */

/* Designed to be run on BSD4.2 systems.  Many work on 4.1 as well */

/* Anyone have any jobs for system andministrators in Hawaii? 
   I am about to graduate and want to go back! */

#include
#include
#include

int errno;

main(argc,argv)
int argc;
char *argv[];
{	
	errno = 0;
	if (argc != 2) fprintf(stderr,"blast: need tty number (only).\n");
	else blast(open(argv[1],O_RDWR,0666));
}

blast(fd)
register FILE *fd;
{
	char c;


	if (errno) return;

	ioctl(fd,TIOCNXCL,0);		/* turn off exclusive use */

	while ( (c=getchar()) != EOF) ioctl(fd,TIOCSTI,&c);
}
--------------------------------------------------------------------------