kern/81951: [patch] linux emulation: getpriority() returns
incorrect value
Andriy Gapon
avg at icyb.net.ua
Thu Jun 9 04:30:18 GMT 2005
The following reply was made to PR kern/81951; it has been noted by GNATS.
From: Andriy Gapon <avg at icyb.net.ua>
To: Maxim.Sobolev at portaone.com
Cc: bug-followup at 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
More information about the freebsd-emulation
mailing list