From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IcaS4-00078r-1C for qemu-devel@nongnu.org; Tue, 02 Oct 2007 01:37:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IcaS3-00077Z-4d for qemu-devel@nongnu.org; Tue, 02 Oct 2007 01:37:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IcaS2-00077P-Vo for qemu-devel@nongnu.org; Tue, 02 Oct 2007 01:37:46 -0400 Received: from owa.c2.net ([207.235.78.2] helo=email.c2.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IcaS2-0005Og-Of for qemu-devel@nongnu.org; Tue, 02 Oct 2007 01:37:46 -0400 Subject: Re: [Qemu-devel] [PATCH] getpriority() shouldn't use libc wrapper From: Thayne Harbaugh In-Reply-To: <1190837168.13060.10.camel@phantasm.home.enterpriseandprosperity.com> References: <1190837168.13060.10.camel@phantasm.home.enterpriseandprosperity.com> Content-Type: text/plain Date: Mon, 01 Oct 2007 23:30:21 -0600 Message-Id: <1191303021.5200.36.camel@phantasm.home.enterpriseandprosperity.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: thayne@c2.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, 2007-09-26 at 14:06 -0600, Thayne Harbaugh wrote: > The linux-user getpriority() syscall goes through the libc wrapper. > This causes a problem because the libc wrapper remaps the return value > from the kernel. This patch calls the kernel getpriority syscall > directly. I didn't see any discussion about this nor did I see it committed. Were there any concerns or objections? It fixes several failures in the LTP test suite. The bug is that the kernel returns -1 on error and 1-40 on success - the libc wrapper remaps this to -1 or error and -20 - 19 on succes (errno must be cleared and checked for the -1 case to determine if there was an error). If qemu uses the libc wrapper then the return value is aleady remapped to negative numbers - which appear to be errors.