aboutsummaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-01-08 15:38:26 +0000
committerRon Yorston <rmy@pobox.com>2019-01-08 15:38:26 +0000
commit59701e7f6a483d4aad4dc7088c673cd69fe294c8 (patch)
treee17a4a69fa80130065a9ce3ad31690530591dbbe /procps/ps.c
parent64a2959683ae6f876966ff81cbd87b1efd14de9d (diff)
downloadbusybox-w32-59701e7f6a483d4aad4dc7088c673cd69fe294c8.tar.gz
busybox-w32-59701e7f6a483d4aad4dc7088c673cd69fe294c8.tar.bz2
busybox-w32-59701e7f6a483d4aad4dc7088c673cd69fe294c8.zip
ps: add user and group columns
Diffstat (limited to 'procps/ps.c')
-rw-r--r--procps/ps.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/procps/ps.c b/procps/ps.c
index 4e6dc1ef9..1f14844e6 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -210,7 +210,6 @@ struct globals {
210 210
211/* Print value to buf, max size+1 chars (including trailing '\0') */ 211/* Print value to buf, max size+1 chars (including trailing '\0') */
212 212
213#if !ENABLE_PLATFORM_MINGW32
214static void func_user(char *buf, int size, const procps_status_t *ps) 213static void func_user(char *buf, int size, const procps_status_t *ps)
215{ 214{
216#if 1 215#if 1
@@ -234,7 +233,6 @@ static void func_group(char *buf, int size, const procps_status_t *ps)
234{ 233{
235 safe_strncpy(buf, get_cached_groupname(ps->gid), size+1); 234 safe_strncpy(buf, get_cached_groupname(ps->gid), size+1);
236} 235}
237#endif
238 236
239static void func_comm(char *buf, int size, const procps_status_t *ps) 237static void func_comm(char *buf, int size, const procps_status_t *ps)
240{ 238{
@@ -385,10 +383,8 @@ static void func_pcpu(char *buf, int size, const procps_status_t *ps)
385 383
386static const ps_out_t out_spec[] = { 384static const ps_out_t out_spec[] = {
387/* Mandated by http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html: */ 385/* Mandated by http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html: */
388#if !ENABLE_PLATFORM_MINGW32
389 { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID }, 386 { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID },
390 { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID }, 387 { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID },
391#endif
392 { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM }, 388 { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM },
393#if !ENABLE_PLATFORM_MINGW32 389#if !ENABLE_PLATFORM_MINGW32
394 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM }, 390 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM },
@@ -557,7 +553,7 @@ static void format_process(const procps_status_t *ps)
557# define SELINUX_O_PREFIX "label," 553# define SELINUX_O_PREFIX "label,"
558# define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args") 554# define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args")
559#elif ENABLE_PLATFORM_MINGW32 555#elif ENABLE_PLATFORM_MINGW32
560# define DEFAULT_O_STR ("pid,ppid" IF_FEATURE_PS_TIME(",time,etime") ",comm") 556# define DEFAULT_O_STR ("pid,ppid,user" IF_FEATURE_PS_TIME(",time,etime") ",comm")
561#else 557#else
562# define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args") 558# define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args")
563#endif 559#endif