From 96ee38b048031ceefcd8eb169fc1c4bd2bee2eb7 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Tue, 9 Dec 2008 11:18:39 +0000 Subject: libcgroup: Better error reporting for libcgroup From: Ankita Garg 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 Signed-off-by: Ankita Garg Signed-off-by: Dhaval Giani git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@228 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- libcgroup.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libcgroup.h') 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 */ -- cgit