]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: Add function to read /proc/{pid}/cgroup
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 4 Nov 2019 23:16:00 +0000 (23:16 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 12 Dec 2019 22:10:28 +0000 (15:10 -0700)
commit365ecb9cf9398f3fff2cd9bb8eff1adfe3902fc2
tree9856b2ac2a35e393127ad48b90d262b553269e12
parentf723a4b0d99868b5193202c34f5397dee84c3df6
api.c: Add function to read /proc/{pid}/cgroup

This commit adds a function that, given a pid, can read in
the controllers and cgroups listed in /proc/{pid}/cgroup.
The caller is expected to allocate the controller_list[]
and cgroup_list[] arrays as well as null each entry in the
arrays.  cg_get_cgroups_from_proc_cgroups() will allocate
the necessary memory for each string within the arrays.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c