From d227e4aab673364ca9f35fa8ff0e0477385f97f7 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sun, 23 Feb 2020 13:00:08 -0800 Subject: ps: widen pid_t fields. My desktop and laptop have a pid_max of 262144 now. --- toys/posix/ps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 0c8e8e81..cd8c73ea 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -311,13 +311,14 @@ struct procpid { #define XX 64 // force string representation for sorting, etc // TODO: Android uses -30 for LABEL, but ideally it would auto-size. +// TODO: ideally, PID and PPID would auto-size too. struct typography { char *name, *help; signed char width, slot; } static const typos[] = TAGGED_ARRAY(PS, // Numbers. (What's in slot[] is what's displayed, sorted numerically.) - {"PID", "Process ID", 5, SLOT_pid}, - {"PPID", "Parent Process ID", 5, SLOT_ppid}, + {"PID", "Process ID", 6, SLOT_pid}, + {"PPID", "Parent Process ID", 6, SLOT_ppid}, {"PRI", "Priority (dynamic 0 to 139)", 3, SLOT_priority}, {"NI", "Niceness (static 19 to -20)", 3, SLOT_nice}, {"ADDR", "Instruction pointer", 4+sizeof(long), SLOT_eip}, -- cgit v1.2.3