diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-07-01 14:05:09 +0000 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-07-01 14:05:09 +0000 |
commit | fd13e9f6d4f315018fc88258ba965c32e12601da (patch) | |
tree | cf50097167492756530eb25c89904c4d550f2475 /tests/libcgrouptest.h | |
parent | 4f1301efe29a3a37470d10a4bb6a497f2e532be5 (diff) | |
download | libcg-fd13e9f6d4f315018fc88258ba965c32e12601da.tar.gz libcg-fd13e9f6d4f315018fc88258ba965c32e12601da.tar.xz libcg-fd13e9f6d4f315018fc88258ba965c32e12601da.zip |
From: Sudhir Kumar <skumar@linux.vnet.ibm.com>
libcgroup: put common code in a function
This patch puts the common code for creating cgroup structure into
a function struct cgroup *new_cgroup(). The function uses few global
variables which are changed before the function call and takes few
variables as arguments.
Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@93 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests/libcgrouptest.h')
-rw-r--r-- | tests/libcgrouptest.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/libcgrouptest.h b/tests/libcgrouptest.h index 55c94df..1efc4b8 100644 --- a/tests/libcgrouptest.h +++ b/tests/libcgrouptest.h @@ -24,6 +24,7 @@ #include <stdlib.h> #include <string.h> #include <sys/syscall.h> +#include <sys/types.h> #include <libcgroup.h> @@ -53,12 +54,19 @@ u_int64_t val_uint64; bool val_bool; /* Doubt: size of following string. is'nt this wrong ?*/ char val_string[FILENAME_MAX]; /* string value of control parameter */ +uid_t control_uid; +gid_t control_gid; +uid_t tasks_uid; +gid_t tasks_gid; +static int i; void get_controllers(char *name, int *exist); static int group_exist(char *path_group); static int set_controller(int controller, char *controller_name, - char *control_file, char *control_val, char *value); + char *control_file); static int group_modified(char *path_control_file, int value_type); +struct cgroup *new_cgroup(char *group, char *controller_name, + char *control_file, int value_type); static inline pid_t cgrouptest_gettid() { |