Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 15 Apr 2018 14:58:16 -0400
From: Rich Felker <dalias@...ifal.cx>
To: Justine Tunney <jart@...gle.com>
Cc: musl@...ts.openwall.com
Subject: Re: musl nice() posix compliance issue

On Sun, Apr 15, 2018 at 10:17:37AM -0700, Justine Tunney wrote:
> According to Python 2.7 autoconf, musl's nice() function needs to do this.
> I checked latest release and HEAD.
> 
>    C library/kernel differences
>        POSIX.1 specifies that nice() should return the new nice value.
> However, the raw Linux system call returns 0 on success.  Likewise, the
> nice() wrapper function provided in glibc 2.2.3 and
>        earlier returns 0 on success.

This analysis seems correct, and from what I can tell, the SYS_nice
syscall simply isn't usable to implement nice() because it doesn't
provide the resulting nice level. So I think we have to fully drop use
of it. OTOH SYS_get/setpriority are also problematic because of
non-atomicity; we can and probably should try to patch that up by
blocking signals and taking a lock around the operation -- but I'm not
sure Linux even correctly applies the priority to all threads rather
than just the calling thread, anyway... Do you know?

Rich

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ