diff options
Diffstat (limited to 'include/libcgroup.h')
-rw-r--r-- | include/libcgroup.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/libcgroup.h b/include/libcgroup.h index 3d5660c..0942161 100644 --- a/include/libcgroup.h +++ b/include/libcgroup.h @@ -364,6 +364,18 @@ int cgroup_get_controller_end(void **handle); */ int cgroup_get_subsys_mount_point(char *controller, char **mount_point); +/** + * Find the parent of the specified directory. It returns the parent (the + * parent is usually name/.. unless name is a mount point. + * + * @param cgroup The cgroup. + * @param parent Output, name of parent's group (if the group has parent) or + * NULL, if the provided cgroup is the root group and has no parent. + * Caller is responsible for freeing the returned string! + * @return 0 on success, >0 on error. + */ +int cgroup_find_parent(struct cgroup *cgroup, char **parent); + /* The wrappers for filling libcg structures */ struct cgroup *cgroup_new_cgroup(const char *name); |