aboutsummaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-08-29 14:55:24 +0100
committerRon Yorston <rmy@pobox.com>2023-08-29 15:11:14 +0100
commit89e67c6f7a77e0e16cbf394f18d4cb121e37f544 (patch)
treec286c985453ff263dc6d84774e18b298399e35e5 /procps/ps.c
parentd6fb7a2c36f8a6d5fac4754cdfdb5483a03f2892 (diff)
downloadbusybox-w32-89e67c6f7a77e0e16cbf394f18d4cb121e37f544.tar.gz
busybox-w32-89e67c6f7a77e0e16cbf394f18d4cb121e37f544.tar.bz2
busybox-w32-89e67c6f7a77e0e16cbf394f18d4cb121e37f544.zip
ps: increase length of 'comm' field
In Linux the command name associated with a process (as can be obtained from '/proc/<PID>/comm') is truncated to 16 characters. Thus upstream BusyBox only allows 16 characters for the 'comm' field in 'ps'. There's no need for such a constraint in busybox-w32. Moreover, the command name is used for the full command line ('args' field) in most cases. This field is allowed to be rather long in 'ps' so it's not expected to be truncated. Still, to avoid diverging too much from upstream it's best to have some measure of truncation. Increase the allowed length of the command name to 32 characters. Adds 16 bytes. (GitHub issue #358)
Diffstat (limited to 'procps/ps.c')
-rw-r--r--procps/ps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/procps/ps.c b/procps/ps.c
index 823539b9a..329576eb8 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -383,7 +383,11 @@ static const ps_out_t out_spec[] ALIGN_PTR = {
383/* Mandated by http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html: */ 383/* Mandated by http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html: */
384 { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID }, 384 { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID },
385 { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID }, 385 { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID },
386#if ENABLE_PLATFORM_MINGW32
387 { COMM_LEN , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM },
388#else
386 { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM }, 389 { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM },
390#endif
387 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM }, 391 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM },
388 { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID }, 392 { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID },
389 { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID }, 393 { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID },