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!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!hao!seismo!brl-tgr!tgr!geoff@utcs.uucp
From: geoff@utcs.uucp
Newsgroups: net.unix-wizards
Subject: nice(1) takes an absolute priority argument
Message-ID: <6480@brl-tgr.ARPA>
Date: Sat, 8-Dec-84 03:51:50 EST
Article-I.D.: brl-tgr.6480
Posted: Sat Dec  8 03:51:50 1984
Date-Received: Mon, 10-Dec-84 02:16:21 EST
Sender: news@brl-tgr.ARPA
Organization: Ballistic Research Lab
Lines: 24

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 
< #include 
< 
24,27c20
< 	if (setpriority(PRIO_PROCESS, 0, nicarg) < 0) {
< 		perror("setpriority");
< 		exit(1);
< 	}
---
> 	nice(nicarg);