Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130415014510.GS20323@brightrain.aerifal.cx>
Date: Sun, 14 Apr 2013 21:45:10 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: nice standards complaince issue

On Sat, Apr 13, 2013 at 11:23:08PM +0100, Justin Cormack wrote:
> Since glibc 2.2.4, nice() is implemented as a library function that calls
> getpriority(2) to obtain the new nice value to be returned  to  the
>  caller.   With this implementation, a successful call can legitimately
> return -1.  To reliably detect an error, set errno to 0 before the call,
> and check its value when nice() returns -1.

Thanks for the heads-up. Actually, I think there's a much bigger issue
with both nice and setpriority: they're affecting one thread rather
than the process. This may technically not be non-conforming as long
as SCHED_OTHER scheduling is in effect, but it's sketchy. Basically
this all stems from a complete failure of Linux to support process
contention scope and the [PS] option of POSIX... (despite glibc
claiming to support it!)

In any case, the issue you reported should be fixed. Do you have a
proposed patch?

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.