06.state_field.patch revision 5655
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger# This patch was added for
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger# 15706228 SUNBT7032615 top thinks that systems have 99 or fewer CPUs
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase--- top-3.8beta1/machine/m_sunos5.c.orig 2016-03-23 10:33:23.778848582 -0700
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+++ top-3.8beta1/machine/m_sunos5.c 2016-03-23 10:33:37.697844284 -0700
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase@@ -436,14 +436,22 @@
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase if (pp->px_state == SONPROC && cpucount > 1)
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase /* large #s may overflow colums */
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase- if (pp->px_onpro < 100)
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ if (pp->px_onpro < 1000)
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase- return snprintf(buf, sz, "cpu/%-2d", pp->px_onpro);
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ return snprintf(buf, sz, "cpu/%-3d", pp->px_onpro);
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase- return snprintf(buf, sz, "cpu/**");
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ if (pp->px_onpro < 10000)
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ return snprintf(buf, sz, "cp/%-4d", pp->px_onpro);
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ if (pp->px_onpro < 100000)
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ return snprintf(buf, sz, "c/%-5d", pp->px_onpro);
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase+ return snprintf(buf, sz, "cpu/***");
37376063320bfb86e0cb9fd4eda25c52c4a667b8Tim Reddehase- return snprintf(buf, sz, "%-6s", state_abbrev[(int)pp->px_state]);
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger+ return snprintf(buf, sz, "%-7s", state_abbrev[(int)pp->px_state]);
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger@@ -488,7 +496,7 @@
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger { "NICE", 4, 1, 0, fmt_nice },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger { "SIZE", 5, 1, 0, fmt_size },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger { "RES", 5, 1, 0, fmt_res },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger- { "STATE", 6, 0, 0, fmt_state },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger+ { "STATE", 7, 0, 0, fmt_state },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger { "TIME", 6, 1, 0, fmt_time },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger { "CPU", 6, 1, 0, fmt_cpu },
e8ceec219830407bded84634716d37d45d3a5872Julian Kornberger { "COMMAND", 7, 0, 0, fmt_command },