added tgid support plus miscellaneous cleanup

ps
   . added tgid support
   . made process/task naming consistent
 top
   . added tgid support
   . standardized pid related width logic
 documents
   . added tgid to ps & top man documents
 library
   . fixed OOMEM_ENABLE readtask bug
   . corrected header typo for tgid
This commit is contained in:
Craig Small
2011-08-17 21:01:35 +10:00
parent bb4f08ba29
commit 0e6ac0db3e
7 changed files with 108 additions and 56 deletions

View File

@ -918,9 +918,9 @@ static proc_t* simple_readtask(PROCTAB *restrict const PT, const proc_t *restric
#ifdef OOMEM_ENABLE
if (unlikely(flags & PROC_FILLOOM)) {
if (likely(file2str(path, "oom_score", sbuf, sizeof sbuf) != -1))
oomscore2proc(sbuf, p);
oomscore2proc(sbuf, t);
if (likely(file2str(path, "oom_adj", sbuf, sizeof sbuf) != -1))
oomadj2proc(sbuf, p);
oomadj2proc(sbuf, t);
}
#endif

View File

@ -139,7 +139,7 @@ typedef struct proc_t {
pgrp, // stat process group id
session, // stat session id
nlwp, // stat,status number of threads, or 0 if no clue
tgid, // (special) task group ID, the POSIX PID (see also: tid)
tgid, // (special) thread group ID, the POSIX PID (see also: tid)
tty, // stat full device number of controlling terminal
euid, egid, // stat(),status effective
ruid, rgid, // status real