[Toybox] [PATCH] top: differentiate tasks (processes) and threads in the header.

enh enh at google.com
Fri Feb 15 16:31:49 PST 2019


---
 toys/posix/ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index faddf685..ea383bfb 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1556,8 +1556,8 @@ static void top_common(
           for (i = 0; i<mix.count; i++)
             run[1+stridx("RSTZ", *string_field(mix.tb[i], &field))]++;
           sprintf(toybuf,
-            "Tasks: %d total,%4ld running,%4ld sleeping,%4ld stopped,"
-            "%4ld zombie", mix.count, run[1], run[2], run[3], run[4]);
+            "%ss: %d total,%4ld running,%4ld sleeping,%4ld
stopped,%4ld zombie",
+            FLAG(H)?"Thread":"Task", mix.count, run[1], run[2],
run[3], run[4]);
           lines = header_line(lines, 0);

           if (readfile("/proc/meminfo", toybuf, sizeof(toybuf))) {
-- 
2.21.0.rc0.258.g878e2cd30e-goog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-top-differentiate-tasks-processes-and-threads-in-the.patch
Type: text/x-patch
Size: 1076 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20190215/a6a33f23/attachment-0002.bin>


More information about the Toybox mailing list