delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/08/14/16:02:36

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:reply-to:to:subject:date:message-id
:content-type:content-transfer-encoding:mime-version; q=dns; s=
default; b=nZ293XX23wwzDhEmAJCgDPMbziOkMyNT119TAkRzRpWgbNzNuwXbI
fDLdDb2eyqxsVMm1Vjp9AyGZ8s6aO48vNaEUG189ZJZ0v51w6ZdtZ2w78gHsVqZf
DR+tH0+pVTSjbjB1AilS/EDuUArkc5ANDnos1MMpWZR+zMTYTdSHqs=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:reply-to:to:subject:date:message-id
:content-type:content-transfer-encoding:mime-version; s=default;
bh=rUnv0XsGm6gnWUXuBULmjnZmWnI=; b=jXesO8JiEtC5OvypTXQkccUn7Bh8
O9OXBobNS4vPY18jxku0Ipl3nsazU4VG7RCPxFBIbFP3TZYku8HokfTaBiodo49j
iOFuL6S3z/UqBLVg2ZGgUDIWkJ1UkzEBmnPy4fJJGWj5okoceV6Zp79cMlJ8kFak
Iqfz1qnZx2G+V3g=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=
X-HELO: nihcesxway5.hub.nih.gov
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.gov; i=@nih.gov; q=dns/txt; s=NIH; t=1565812902; x=1597348902; h=from:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=ufsg/OQokG2FBMNWNkrdcf/5ao2uNfMrtTVMsoi5fzU=; b=GBRvn5WFwKdUD7jw3FenoCRg8PrNTRLBuE5eCoCzn3nl2gHjAzsW6HGH kbpwje9NNKKiM3HXAD9NNLs7Q53zsD/Z+XxxvqXO4lCyNQFCMq9uVaV6x MQrO8F2YtQFcJGm5GNPfAru8KzAL6JI0e9SReH/tHLuupjw5L4wV0ccc5 erDbGSHy4WFpRlGcInMLQPNO/DoDj8OcAjuUqKnbuzVhabGS0N18voqoR Hw9d7vevXWvMdepkPOzMvxrQCsKwIZYtPh9DCEFwMInjir+/nXa6lKdD3 H/f+0+XKFwcml/N63l3NrKQowI+2pBBtTkETaaZZzNioE+XPTTy17efNp A==;
IronPort-SDR: pWKCciPGoLpyMynVX6O+1QLdYS/cBolGu9Y5ViL2WVxBheh3F9zfMng6e7G56wJwaBE6H6gEzS LV54xfL0zvPQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CC/A/679avwXVG/VVgyC/dNZ//4eatE3AQLGUj5l0mj05wQbSP6EF2+G5SGr9DHYfUMR8xugngYA5LjJQmooaDqgxe26qyk15e753b8ET/ZOCx0sbF4I/khx0yozdScRBzcGXK1g+6uKNEN+R3Rkb9pBb2XlPMoXotnfOIHWYsgVOyehU6cSTYNwRpfox6MEbA9gTbyR4dcWZt0sGB6AOFUw+IablIZopvhSfk4EF57Jbpf3MVbh9JOo147CIJze8ig61GMQsv7QjJDfqfrbOVKh8VvfAdu6GnJ7IE428BPiRTNDKig1Rkr12P8Itfst62PhjYS2cVrf1c/W96rwaw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ufsg/OQokG2FBMNWNkrdcf/5ao2uNfMrtTVMsoi5fzU=; b=f5Pzx9PeiOC/MiXDfJoslq3rTZgZ+XeE4Tl+vCPlqyAbYQdHdRWWwKmDMlB+ASV03HOWvfHIgOeQCWSxm+mO9rDiP5NIF8lMyMUwGeP8xV+sCLy5TDYVzwZ8m4BKLFm7KZ0kRi/HOlPYU3OyfO9L6tJD9rMEUUFKkTDTBU/dnTdtDZgc75gGPjF7UaD2fUq3BWyYBdPG2eajlGLaMlq64ocr67bjk7ko3sIOngjH6sdvU8kPgxslatUmGfvK+V6/lDXPXitMdbgf3eruOZbOFxH8l7J4jeWI37V+a9uWf9d2B4+zEEO+Dv5IO4/gE0KLgXlmWUwr4FojJDUMPCTOzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.onmicrosoft.com; s=selector2-nih-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ufsg/OQokG2FBMNWNkrdcf/5ao2uNfMrtTVMsoi5fzU=; b=EBQjduW7CYVJHD6mZxLZF459ZLHJOaK38vme/tOBDUhkk4h6bnex3CpV93YwQqdpIt+uZ/JUWirhawK4+74JUryeJWrdMC+A841dlW9nLXFxR1V8h7XTG3n4ifiDQ6NnFPq5KOmdL8OYZButCE16Wdps2BCx86MuRZRiZioNxGE=
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin AT cygwin DOT com>
Reply-To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Re: getpriority() and top display for priority inconsistent
Date: Wed, 14 Aug 2019 20:01:25 +0000
Message-ID: <BN6PR09MB1409FFA3C34F0EF48915C4E1A5AD0@BN6PR09MB1409.namprd09.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr AT ncbi DOT nlm DOT nih DOT gov;
x-ms-exchange-purlcount: 1
x-ms-oob-tlc-oobclassifiers: OLM:3631;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Eb/eGzTT5cp3HuAbF+5iUNzkrGdlF8fwL2luAHV24269xnqneyZ7wM32HQAxl8w5
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x7EK2I1t023973

> 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)

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019