library: rework namespace calls

Functions related to namespaces were half-in half-out of the
procps library and didn't fit the standard naming scheme.

While struct { long ns[x]} is a bit clunky, its the only way
to "lock in" x. The alternative is to use ns_* variables.

This work was needed before pgrep could be converted.
This commit is contained in:
Craig Small
2015-09-03 22:32:19 +10:00
parent d9caf0980e
commit a61f78d6e0
16 changed files with 297 additions and 134 deletions

View File

@@ -172,12 +172,12 @@ REG_set(MEM_VIRT, sl_int, size)
CVT_set(MEM_VIRT_KIB, ul_int, size)
REG_set(NICE, sl_int, nice)
REG_set(NLWP, s_int, nlwp)
REG_set(NS_IPC, ul_int, ns[0])
REG_set(NS_MNT, ul_int, ns[1])
REG_set(NS_NET, ul_int, ns[2])
REG_set(NS_PID, ul_int, ns[3])
REG_set(NS_USER, ul_int, ns[4])
REG_set(NS_UTS, ul_int, ns[5])
REG_set(NS_IPC, ul_int, ns.ns[0])
REG_set(NS_MNT, ul_int, ns.ns[1])
REG_set(NS_NET, ul_int, ns.ns[2])
REG_set(NS_PID, ul_int, ns.ns[3])
REG_set(NS_USER, ul_int, ns.ns[4])
REG_set(NS_UTS, ul_int, ns.ns[5])
REG_set(OOM_ADJ, s_int, oom_adj)
REG_set(OOM_SCORE, s_int, oom_score)
REG_set(PRIORITY, s_int, priority)