diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-04-07 13:27:39 +0000 |
---|---|---|
committer | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-04-07 13:27:39 +0000 |
commit | 807404116413414133a7adf40e964ab82192a68b (patch) | |
tree | 956b3f5b0850949209d482627eadf73b841243ed /libcg.h | |
parent | 726565d64ebed21da79b3ba03b1d4141f97440f1 (diff) | |
download | libcg-807404116413414133a7adf40e964ab82192a68b.tar.gz libcg-807404116413414133a7adf40e964ab82192a68b.tar.xz libcg-807404116413414133a7adf40e964ab82192a68b.zip |
This patch modifies libcg to use the new cgroup data structure.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
The code is yet to be tested though
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@7 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'libcg.h')
-rw-r--r-- | libcg.h | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -21,6 +21,7 @@ __BEGIN_DECLS #include <grp.h> +#include <linux/types.h> #include <stdio.h> #include <sys/stat.h> @@ -139,17 +140,31 @@ int cg_unmount_controllers(void); int cg_load_config(const char *pathname); void cg_unload_current_config(void); +#define CG_NV_MAX 100 +#define CG_CONTROLLER_MAX 100 /* Functions and structures that can be used by the application*/ struct control_value { char name[FILENAME_MAX]; char *value; }; +struct cgroup{ + char *name; + struct { + char *name; + struct control_value *values[CG_NV_MAX]; + } *controller[CG_CONTROLLER_MAX]; + uid_t tasks_uid; + gid_t tasks_gid; + uid_t control_uid; + gid_t control_gid; +}; + int cg_init(void); -int cg_attach_task(char *cgroup); -int cg_modify_cgroup(char *cgroup, struct control_value *values[], int n); -int cg_create_cgroup(char *cgroup, struct control_value *values[], int n); -int cg_delete_cgroup(char *cgroup); +int cg_attach_task(struct cgroup *cgroup); +int cg_modify_cgroup(struct cgroup *cgroup); +int cg_create_cgroup(struct cgroup *cgroup); +int cg_delete_cgroup(struct cgroup *cgroup); __END_DECLS |