summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2009-04-22 15:30:19 +0530
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2009-04-22 15:46:54 +0530
commit9414f3be0c3f191fdea212ecc3157af5e70a45de (patch)
treeefff88098ef8f5753cc6573d014d18cce1ac00fc /include
parent8d8a747b161508ebfd48a6dac52f1438e2714a2b (diff)
downloadlibcg-9414f3be0c3f191fdea212ecc3157af5e70a45de.tar.gz
libcg-9414f3be0c3f191fdea212ecc3157af5e70a45de.tar.xz
libcg-9414f3be0c3f191fdea212ecc3157af5e70a45de.zip
libcgroup: Add new API to walk tasks
Add a new API to iterate through the tasks file to get the list of all the tasks in a cgroup. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcgroup.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/libcgroup.h b/include/libcgroup.h
index efa852b..085c17a 100644
--- a/include/libcgroup.h
+++ b/include/libcgroup.h
@@ -274,6 +274,25 @@ int cgroup_read_stats_next(void **handle, struct cgroup_stat *stat);
int cgroup_read_stats_end(void **handle);
+/**
+ * Read the tasks file to get the list of tasks in a cgroup
+ * @cgroup: Name of the cgroup
+ * @controller: Name of the cgroup subsystem
+ * @handle: Handle to be used in the iteration
+ * @pid: The pid read from the tasks file. Will be filled in by the API
+ */
+int cgroup_get_task_begin(char *cgroup, char *controller, void **handle,
+ pid_t *pid);
+
+/**
+ * Read the next task value
+ * @handle: The handle used for iterating
+ * @pid: The variable where the value will be stored
+ *
+ * return ECGEOF when the iterator finishes getting the list of tasks.
+ */
+int cgroup_get_task_next(void *handle, pid_t *pid);
+int cgroup_get_task_end(void **handle);
/* The wrappers for filling libcg structures */
struct cgroup *cgroup_new_cgroup(const char *name);