Date: Thu, 9 Jun 2005 04:30:18 GMT From: Andriy Gapon <avg@icyb.net.ua> To: freebsd-emulation@FreeBSD.org Subject: Re: kern/81951: [patch] linux emulation: getpriority() returns incorrect value Message-ID: <200506090430.j594UILr099075@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/81951; it has been noted by GNATS. From: Andriy Gapon <avg@icyb.net.ua> To: Maxim.Sobolev@portaone.com Cc: bug-followup@FreeBSD.org Subject: Re: kern/81951: [patch] linux emulation: getpriority() returns incorrect value Date: Thu, 09 Jun 2005 07:22:32 +0300 on 08.06.2005 23:49 Maxim Sobolev said the following: > Committed, thanks! > > I wonder if the setpriority(2) needs the same cure. Please clarify and > let me know. I'll keep the PR open till your reply. > Maxim, setpriority(2) is not affected, the reason for this assymetry is in Linux's convention for system calls - they return both result and errno in the same register, positive values are reserved for results of successful calls and negative are reserved for -errno for failed calls. Thus they can not return negative priority values in getpriority(2) and have to shift it to positive range. There is no problem, of course, with passing negative values from userland to kernel. Thank you for the commit! -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506090430.j594UILr099075>