procps/proc
Jim Warner 8b64b36bbf library: standardize handling of cgroup, supgid
Some inconsistencies have emerged during development
of support for these relatively new proc_t fields.

For example, a PROC_FILLCGROUP flag (via file2strvec)
could return NULL in cgroup whereas PROC_EDITCGRPCVT
(via fill_cgroup_cvt) *almost* guaranteed a return
address (as is true for PROC_EDITCMDLCVT and cmdline).
But even PROC_EDITCGRPCVT could return NULL if the
kernel version was less than 2.6.24.  Then with NULL
ps would display a "-" while top would show "n/a".

And while unlikely, with the PROC_FILLSTATUS flag (via
status2proc) a NULL supgid address was theoretically
possible and both ps and top would then show "n/a".

This commit standardizes the following usage:
  . PROC_FILLSTATUS         (via status2proc)
      guarantees a valid supgid address
      representing either a true comma
      delimited list or "-"
  . PROC_FILLCGROUP  plus
    PROC_EDITCGRPCVT        (via fill_cgroup_cvt)
      guarantees a cgroup single vector
      representing either a true control
      group hierarchy or "-"

And as was true before, the following remains true:
    PROC_FILLCOM     or
    PROC_FILLARG            (via file2strvec)
      may return a NULL cmdline pointer
  . PROC_FILLCGROUP         (via file2strvec)
      may return a NULL cgroup pointer
  . PROC_FILLCOM     or
    PROC_FILLARG     plus
    PROC_EDITCMDLCVT        (via fill_cmdline_cvt)
      guarantees a cmdline single vector
      representing either a true command
      line or a bracketed program name
  . PROC_FILLSTATUS  plus
    PROC_FILLSUPGRP         (via supgrps_from_supgids)
      guarantees a valid supgrp address
      representing either a true comma
      delimited list or "-"

Signed-off-by: Jim Warner <james.warner@comcast.net>
2012-08-29 17:26:13 +10:00
..
alloc.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
alloc.h library: expanded/generalized memory allocation provisions 2011-12-11 22:26:49 +11:00
COPYING license: update FSF addresses 2012-03-04 08:04:24 +11:00
devname.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
devname.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
escape.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
escape.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
ksym.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
libprocps.pc.in Renaming libprocfs to libprocps 2011-12-23 09:18:43 +11:00
libprocps.sym libprocps: hide private symbols 2012-01-24 21:54:01 +01:00
Makefile.am Increase library revision number 2012-03-03 18:47:40 +11:00
procps.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
pwcache.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
pwcache.h better handling of long usernames 2004-07-20 23:31:12 +00:00
readproc.c library: standardize handling of cgroup, supgid 2012-08-29 17:26:13 +10:00
readproc.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
sig.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
sig.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
slab.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
slab.h Increase slab name from 64 to 128 characters 2012-06-26 22:01:42 +10:00
sysinfo.c libprocps: protect locale environment getting overwrite 2012-04-25 09:34:41 +10:00
sysinfo.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
version.c Description: fix to build on non-Linux arches 2012-06-11 22:11:23 +10:00
version.h name change: procps -> procps-ng 2011-06-04 20:50:12 +02:00
wchan.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
whattime.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
whattime.h big header clean-up 2002-12-09 07:00:07 +00:00