From:	HENRY::IN%"carl%CITHEX.CALTECH.EDU%SRI-KL.ARPA%relay.cs.net@rca.com"  1-DEC-1986 07:45
To:	info-vax@CITHEX.CALTECH.EDU
Subj:	Shorter alternate to STOP/FORCE

I don't know what you did to make your version of a program to force exits
of other processes take thirty-odd blocks (unless you're counting the include
files that DEC supplies in your count), but here's a C program that does
basically the same thing (it doesn't use the CLI routines that yours does,
but DOES let you specify processes by name) that only takes two blocks
(actually, 766 characters):
/*------FORCEX.C--------------FILE_STARTS_HERE-------------------------------*/
#include <descrip.h>
#include <ssdef.h>
#define OK(value) (((stat = (value)) & 7) == 1)
main(nargs, args)
int nargs;
char **args;
{   static char buffer[80] = { '0', 'x', '\0' };
    char temp[80];
    static $DESCRIPTOR(prcnam, buffer);
    static long stat, pid;
    extern long SYS$FORCEX();
    long *pidadr = &pid;
    struct dsc$descriptor *ptr = &prcnam;

    if (nargs == 1)
	strcat(buffer, "0");
    else if (nargs == 2) {
	strcat(buffer, *++args);
  	if (sscanf(buffer, "%x%s", &pid, temp) == 1)
		ptr = 0;
	else {
     		prcnam.dsc$a_pointer = buffer + 2;
		prcnam.dsc$w_length = strlen(prcnam.dsc$a_pointer);
		pidadr = 0;
	}
    } else {
      	puts("USAGE: FORCEX pid\n\tor\n       FORCEX prcnam");
	exit(1);
    }  exit(SYS$FORCEX(pidadr, ptr, 1));
}
/*------FORCEX.C--------------FILE_ENDS_HERE---------------------------------*/
