We had no way of getting the name from the cgroup structure. We
have enough users who do want this information. Provide an API
to do so.
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
Cc: Glauber Costa <glommer@parallels.com>
int cg_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode,
int dirm_change, mode_t file_mode, int filem_change);
+/**
+ * Get the name of the cgroup from a given cgroup
+ * @param cgroup The cgroup whose name is needed
+ */
+char *cgroup_get_cgroup_name(struct cgroup *cgroup);
+
/**
* @}
* @}
return NULL;
}
+char *cgroup_get_cgroup_name(struct cgroup *cgroup)
+{
+ if (!cgroup)
+ return NULL;
+
+ return cgroup->name;
+}