[net.bugs.4bsd] nice

geoff@utcs.UUCP (Geoff Collyer) (12/04/84)

Index:	bin/nice.c 4.2BSD

Description:
	Despite the claim in nice(1) that the number argument is the
	amount by which ``the priority is incremented'', it is actually
	presented to setpriority(2) as an *absolute* priority, not an
	increment.
Repeat-By:
	As an ordinary (non-super) user, type
		nice -2 nice -1 date
	nice will print
		setpriority: Permission denied
Fix:
	My fix was to use nice(3c) instead of the overkill of getpriority(2).
	Diffs follow:
7,9d4
< #include <sys/time.h>
< #include <sys/resource.h>
< 
24,27c20
< 	if (setpriority(PRIO_PROCESS, 0, nicarg) < 0) {
< 		perror("setpriority");
< 		exit(1);
< 	}
---
> 	nice(nicarg);