From aeb35b18dac71f895915b09b4b63df1765b3c03b Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 14 Dec 2021 00:00:00 -0600 Subject: 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 --- proc/pids.c | 4 ++-- proc/pids.h | 2 +- 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 -- cgit v1.2.1