On 8/27/23 08:57, Karim Taha wrote:
+static inline abi_long do_bsd_getpriority(abi_long which, abi_long who)
+{
+ abi_long ret;
+ /*
+ * Note that negative values are valid for getpriority, so we must
+ * differentiate based on errno settings.
+ */
+ errno = 0;
+ ret = getpriority(which, who);
+ if (ret == -1 && errno != 0) {
+ ret = -host_to_target_errno(errno);
+ return ret;
+ }
+ /* Return value is a biased priority to avoid negative numbers. */
+ ret = 20 - ret;
This appears to be a linux-ism.
There is no such bias in sys/kern/kern_resource.c, kern_getpriority(), but there is in
sys/compat/linux/linux_misc.c, linux_getpriority().
r~