public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: getpriority() consistent with process priority
@ 2019-10-31 20:40 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-10-31 20:40 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=fe239aef1b397145707561fa0bb0a8795cf41fd0

commit fe239aef1b397145707561fa0bb0a8795cf41fd0
Author: Anton Lavrentiev via cygwin-patches <cygwin-patches@cygwin.com>
Date:   Wed Oct 30 11:47:25 2019 -0400

    Cygwin: getpriority() consistent with process priority
    
    https://cygwin.com/ml/cygwin/2019-08/msg00122.html

Diff:
---
 winsup/cygwin/syscalls.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-31 20:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 20:40 [newlib-cygwin] Cygwin: getpriority() consistent with process priority Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).