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