]> granicus.if.org Git - procps-ng/commitdiff
library: change 'PIDS_PROCESSOR' into a signed integer
authorJim Warner <james.warner@comcast.net>
Tue, 14 Dec 2021 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@dropbear.xyz>
Thu, 16 Dec 2021 09:50:07 +0000 (20:50 +1100)
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>
proc/pids.c
proc/pids.h

index f932ae513b81584f8ee4d92236361b07f016415b..88fe1462500e2b0de12ad66d21cd607fd274732c 100644 (file)
@@ -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)  },
index 2d6e33598a69ee6f0fef49a48ec4322508866a8b..0a94d39640b2df6b1893c9befc044d5ef43b34e5 100644 (file)
@@ -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