From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12721 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: musl nice() posix compliance issue Date: Mon, 16 Apr 2018 17:35:13 -0400 Message-ID: <20180416213513.GZ3094@brightrain.aerifal.cx> References: <20180415185816.GW3094@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1523914409 6913 195.159.176.226 (16 Apr 2018 21:33:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2018 21:33:29 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: musl@lists.openwall.com To: Justine Tunney Original-X-From: musl-return-12737-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 16 23:33:25 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1f8Bka-0001gA-C1 for gllmg-musl@m.gmane.org; Mon, 16 Apr 2018 23:33:24 +0200 Original-Received: (qmail 30557 invoked by uid 550); 16 Apr 2018 21:35:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30532 invoked from network); 16 Apr 2018 21:35:30 -0000 Content-Disposition: inline In-Reply-To: <20180415185816.GW3094@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12721 Archived-At: On Sun, Apr 15, 2018 at 02:58:16PM -0400, Rich Felker wrote: > 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? It doesn't, but this is a separate bug that can be worked around on its own. I'll apply a fix for the part you reported first. Rich