V5/usr/source/s2/nice.c

Compare this file to the similar file:
Show the results in this format:

/* nice */
char	*args[100];
char	string[10000];

main(argc, argv)
int argc;
char *argv[];
{
	int i;
	char **argp, *strp, *p;

	if(argc < 2) {
		printf("arg count\n");
		exit();
	}
	argc--;
	argv++;
	argp = args;
	strp = string;
	for (i=0; i<9; i++)
		*strp++ = "/usr/bin/"[i];
	for(i=0; i<argc; i++) {
		*argp++ = strp;
		p = *argv++;
		while(*strp++ = *p++);
	}
	*argp = 0;
	nice(16);
	execv(string+9, args);
	execv(string+4, args);
	execv(string, args);
	printf("%s not found\n", string+9);
}