From 9f9c3a16ce8fdc92320818ddb6c1588c90c116dd Mon Sep 17 00:00:00 2001 From: albert <> Date: Fri, 26 Mar 2004 01:34:16 +0000 Subject: [PATCH] STAT flags for fg process group and session leader --- NEWS | 1 + ps/output.c | 10 ++++++---- ps/ps.1 | 10 +++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 43b4e1f6..6c00fc8d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ procps-3.2.0 --> procps-3.2.1 build w/ curses in odd location +ps: STAT flags for fg process group and session leader procps-3.1.15 --> procps-3.2.0 diff --git a/ps/output.c b/ps/output.c index 6d73caa3..10413ab9 100644 --- a/ps/output.c +++ b/ps/output.c @@ -566,10 +566,12 @@ static int pr_oldstate(char *restrict const outbuf, const proc_t *restrict const static int pr_stat(char *restrict const outbuf, const proc_t *restrict const pp){ int end = 0; outbuf[end++] = pp->state; - if(pp->rss == 0 && pp->state != 'Z') outbuf[end++] = 'W'; - if(pp->nice < 0) outbuf[end++] = '<'; - if(pp->nice > 0) outbuf[end++] = 'N'; - if(pp->vm_lock) outbuf[end++] = 'L'; +// if(pp->rss==0 && pp->state!='Z') outbuf[end++] = 'W'; // useless "swapped out" + if(pp->nice < 0) outbuf[end++] = '<'; + if(pp->nice > 0) outbuf[end++] = 'N'; + if(pp->vm_lock) outbuf[end++] = 'L'; + if(pp->session == pp->tgid) outbuf[end++] = 's'; // session leader + if(pp->pgrp == pp->tpgid) outbuf[end++] = '+'; // in foreground process group outbuf[end] = '\0'; return end; } diff --git a/ps/ps.1 b/ps/ps.1 index 8e7c0d5a..bfaae524 100644 --- a/ps/ps.1 +++ b/ps/ps.1 @@ -261,18 +261,18 @@ D uninterruptible sleep (usually IO) R runnable (on run queue) S sleeping T traced or stopped -W paging +W paging (2.4 kernels and older only) X dead Z a defunct ("zombie") process For BSD formats and when the "stat" keyword is used, additional -letters may be displayed: +characters may be displayed: -W has no resident pages -< high-priority process +< high-priority task N low-priority task L has pages locked into memory (for real-time and custom IO) - +s is a session leader ++ is in the foreground process group SORT KEYS -- 2.40.0