supgid/supgrp support, improved library interface

Library changes
   readproc
    . added support for supplementary groups
    . eliminated 2 potential mem leak sources
       . shortcut used for multi-threaded str
         vectors & ptrs was obsoleted
       . freeing of proc_t related dynamic
         memory now rests with the library
    . standardized/normalized many c comments
   sysinfo
    . corrected note regarding glibc & cpuinfo
   library.map
    . made the visible freeproc accessable
 Program changes
   pmap
    . initialized buffer for new readproc i/f
    . eliminated now obsolete free() call
   ps
    . added width aware supgrp support
    . initialized buffers for new readproc i/f
    . eliminated now obsolete free() calls
   top
    . added supgrp support as variable width
    . eliminated now obsolete free() calls
    . expoilted library freeproc function
    . corrected -h|v args text & spacing
    . updated some c comments
 Documentation changes
   ps.1
    . added supgid and supgrp
   top.1
    . added supgid and supgrp
    . addition of above required renumbering
      many fields in section 3a. DESCRIPTIONS
This commit is contained in:
Craig Small
2011-08-01 21:28:46 +10:00
parent 3f59ff5a16
commit 3ef4823f90
11 changed files with 306 additions and 217 deletions

2
pmap.c
View File

@ -358,11 +358,11 @@ int main(int argc, char *argv[]){
discover_shm_minor();
memset(&p, '\0', sizeof(p));
pidlist[count] = 0; // old libproc interface is zero-terminated
PT = openproc(PROC_FILLSTAT|PROC_FILLARG|PROC_PID, pidlist);
while(readproc(PT, &p)){
ret |= one_proc(&p);
if(p.cmdline) free((void*)*p.cmdline);
count--;
}
closeproc(PT);