STAT flags for fg process group and session leader

This commit is contained in:
albert 2004-03-26 01:34:16 +00:00
parent 63b001e5b9
commit 9f9c3a16ce
3 changed files with 12 additions and 9 deletions

1
NEWS
View File

@ -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

View File

@ -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;
}

10
ps/ps.1
View File

@ -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