V10/cmd/nice.c

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

static char *sccsid = "@(#)nice.c	4.1 (Berkeley) 10/1/80";
/* nice */

#include <stdio.h>

main(argc, argv)
int argc;
char *argv[];
{
	int nicarg = 10;
	extern errno;
	extern char *sys_errlist[];

	if(argc > 1 && argv[1][0] == '-') {
		nicarg = atoi(&argv[1][1]);
		argc--;
		argv++;
	}
	if(argc < 2) {
		fputs("usage: nice [ -n ] command\n", stderr);
		exit(1);
	}
	nice(nicarg);
	execvp(argv[1], &argv[1]);
	fprintf(stderr, "%s: %s\n", sys_errlist[errno], argv[1]);
	exit(1);
}