library: expanded to provide for the UID used at login

This patch represents the newlib implementation of Jan
Rybar's merge request referenced below. It essentially
moves that code out of the ps program and into our new
library where it's available via the <pids> interface.

Reference(s):
https://gitlab.com/procps-ng/procps/merge_requests/57
https://bugzilla.redhat.com/show_bug.cgi?id=1518986

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2018-02-11 01:11:11 -06:00
committed by Craig Small
parent 52f0ee2c41
commit f341bd4632
4 changed files with 32 additions and 0 deletions

View File

@ -165,6 +165,8 @@ typedef struct proc_t {
*sd_uunit; // n/a systemd user unit id
char
*lxcname; // n/a lxc container name
int
luid; // loginuid user id at login
} proc_t;
// PROCTAB: data structure holding the persistent information readproc needs
@ -223,6 +225,7 @@ typedef struct PROCTAB {
#define PROC_FILLNS 0x8000 // fill in proc_t namespace information
#define PROC_FILLSYSTEMD 0x80000 // fill in proc_t systemd information
#define PROC_FILL_LXC 0x800000 // fill in proc_t lxcname, if possible
#define PROC_FILL_LUID 0x400000 // fill in proc_t luid (login user id)
#define PROC_LOOSE_TASKS 0x2000 // treat threads as if they were processes