library: make sure that the proc_t is now fixed length

The former variable length structure created potential
problems for library users like that referenced below.

We will now parallel the same approach newlib uses for
the configure options --enable-oomem & --with-systemd.
Thus, the --enable-oomem and OOMEM_ENABLE #define have
been eliminated and the --with-systemd option (#define
WITH_SYSTEMD) will hereafter impact one function only.

The proc_t struct itself will now *never* be impacted.

Reference(s):
https://gitlab.com/procps-ng/procps/issues/31

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2016-06-02 00:00:00 -05:00
committed by Craig Small
parent 10503c03d4
commit 32db4e99a6
3 changed files with 10 additions and 32 deletions

View File

@@ -167,14 +167,11 @@ typedef struct proc_t {
tpgid, // stat terminal process group id
exit_signal, // stat might not be SIGCHLD
processor; // stat current (or most recent?) CPU
#ifdef OOMEM_ENABLE
int
oom_score, // oom_score (badness for OOM killer)
oom_adj; // oom_adj (adjustment to OOM score)
#endif
long
ns[NUM_NS]; // (ns subdir) inode number of namespaces
#ifdef WITH_SYSTEMD
char
*sd_mach, // n/a systemd vm/container name
*sd_ouid, // n/a systemd session owner uid
@@ -183,7 +180,6 @@ typedef struct proc_t {
*sd_slice, // n/a systemd slice unit
*sd_unit, // n/a systemd system unit id
*sd_uunit; // n/a systemd user unit id
#endif
const char
*lxcname; // n/a lxc container name
} proc_t;