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!cbosgd!ihnp4!zehntel!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: <6569@brl-tgr.ARPA> Date: Sun, 9-Dec-84 18:19:45 EST Article-I.D.: brl-tgr.6569 Posted: Sun Dec 9 18:19:45 1984 Date-Received: Tue, 11-Dec-84 04:50:18 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);