summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2021-12-14 00:00:00 -0600
committerCraig Small <csmall@dropbear.xyz>2021-12-16 20:50:07 +1100
commitaeb35b18dac71f895915b09b4b63df1765b3c03b (patch)
treebc0ae1b75cce0ba489d59c2bce9374c52e987f9f
parentbcb837b8c73f23536a2403b61deeb2b7b3c6be20 (diff)
downloadprocps-ng-aeb35b18dac71f895915b09b4b63df1765b3c03b.tar.gz
library: change 'PIDS_PROCESSOR' into a signed integer
This change is really being made on behalf of the ps & top programs. Besides, over 2 billion CPUs are plenty! Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r--proc/pids.c4
-rw-r--r--proc/pids.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/proc/pids.c b/proc/pids.c
index f932ae5..88fe146 100644
--- a/proc/pids.c
+++ b/proc/pids.c
@@ -227,7 +227,7 @@ REG_set(OOM_ADJ, s_int, oom_adj)
REG_set(OOM_SCORE, s_int, oom_score)
REG_set(PRIORITY, s_int, priority)
REG_set(PRIORITY_RT, s_int, rtprio)
-REG_set(PROCESSOR, u_int, processor)
+REG_set(PROCESSOR, s_int, processor)
setDECL(PROCESSOR_NODE) { (void)I; R->result.s_int = numa_node_of_cpu(P->processor); }
REG_set(RSS, ul_int, rss)
REG_set(RSS_RLIM, ul_int, rss_rlim)
@@ -510,7 +510,7 @@ static struct {
{ RS(OOM_SCORE), f_oom, NULL, QS(s_int), 0, TS(s_int) },
{ RS(PRIORITY), f_stat, NULL, QS(s_int), 0, TS(s_int) },
{ RS(PRIORITY_RT), f_stat, NULL, QS(s_int), 0, TS(s_int) },
- { RS(PROCESSOR), f_stat, NULL, QS(u_int), 0, TS(u_int) },
+ { RS(PROCESSOR), f_stat, NULL, QS(s_int), 0, TS(s_int) },
{ RS(PROCESSOR_NODE), f_stat, NULL, QS(s_int), 0, TS(s_int) },
{ RS(RSS), f_stat, NULL, QS(ul_int), 0, TS(ul_int) },
{ RS(RSS_RLIM), f_stat, NULL, QS(ul_int), 0, TS(ul_int) },
diff --git a/proc/pids.h b/proc/pids.h
index 2d6e335..0a94d39 100644
--- a/proc/pids.h
+++ b/proc/pids.h
@@ -110,7 +110,7 @@ enum pids_item {
PIDS_OOM_SCORE, // s_int oom_score
PIDS_PRIORITY, // s_int stat: priority
PIDS_PRIORITY_RT, // s_int stat: rt_priority
- PIDS_PROCESSOR, // u_int stat: task_cpu
+ PIDS_PROCESSOR, // s_int stat: task_cpu
PIDS_PROCESSOR_NODE, // s_int derived from PROCESSOR, see numa(3)
PIDS_RSS, // ul_int stat: rss
PIDS_RSS_RLIM, // ul_int stat: rsslim