diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-12-09 11:18:39 +0000 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2008-12-09 11:18:39 +0000 |
commit | 96ee38b048031ceefcd8eb169fc1c4bd2bee2eb7 (patch) | |
tree | 578d985f59883daac59438952e572519e1db56df /libcgroup.h | |
parent | 50dce522e4a5a09d43012b1d3d18ac80a5c16863 (diff) | |
download | libcg-96ee38b048031ceefcd8eb169fc1c4bd2bee2eb7.tar.gz libcg-96ee38b048031ceefcd8eb169fc1c4bd2bee2eb7.tar.xz libcg-96ee38b048031ceefcd8eb169fc1c4bd2bee2eb7.zip |
libcgroup: Better error reporting for libcgroup
From: Ankita Garg <ankita@in.ibm.com>
This patch adds human readable error messages to the configuration parser.
The error lookup is implemented as a simple table, indexed by the error.
TODO: Save errno at ECGOTHER and pass it down as cgroup_lasterror.
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Ankita Garg <ankita@in.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@228 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'libcgroup.h')
-rw-r--r-- | libcgroup.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libcgroup.h b/libcgroup.h index 2a93022..4fb99ff 100644 --- a/libcgroup.h +++ b/libcgroup.h @@ -94,6 +94,7 @@ enum cgroup_errors { ECGROUPPARSEFAIL, /* Failed to parse rules configuration file. */ ECGROUPNORULES, /* Rules list does not exist. */ ECGMOUNTFAIL, + ECGSENTINEL, /* Please insert further error codes above this */ }; #define CG_NV_MAX 100 @@ -187,6 +188,12 @@ int cgroup_init_rules_cache(void); */ int cgroup_get_current_controller_path(pid_t pid, const char *controller, char **current_path); +/** + * Return error corresponding to @code in human readable format. + * @code: error code for which the corresponding error string is to be + * returned + */ +char *cgroup_strerror(int code); /* The wrappers for filling libcg structures */ |