getpriority() and top display for priority inconsistent

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Aug 15 07:29:00 GMT 2019


On Aug 14 20:01, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin wrote:
> > Feel free to provide a patch, just, please, create a valid git commit message
> 
> "getpriority() consistent with process priority https://cygwin.com/ml/cygwin/2019-08/msg00122.html"
> 
> The changeset is really trivial:
> 
> diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
> index a914ae8..20126ce 100644
> --- a/winsup/cygwin/syscalls.cc
> +++ b/winsup/cygwin/syscalls.cc
> @@ -3977,7 +3977,12 @@ getpriority (int which, id_t who)
>        if (!who)
>         who = myself->pid;
>        if ((pid_t) who == myself->pid)
> -       return myself->nice;
> +        {
> +          DWORD winprio = GetPriorityClass(GetCurrentProcess());
> +          if (winprio != nice_to_winprio(myself->nice))
> +            myself->nice = winprio_to_nice(winprio);
> +          return myself->nice;
> +        }
>        break;
>      case PRIO_PGRP:
>        if (!who)
> 

git format-patch output with commit message, please?  The commit message
should describe what the problem is and how the patch fixes it.  One or
two sentences are enogh.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190815/19f71e94/attachment.sig>


More information about the Cygwin mailing list