summaryrefslogtreecommitdiffstats
path: root/include/libcgroup/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libcgroup/error.h')
-rw-r--r--include/libcgroup/error.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/libcgroup/error.h b/include/libcgroup/error.h
new file mode 100644
index 0000000..4d756ff
--- /dev/null
+++ b/include/libcgroup/error.h
@@ -0,0 +1,58 @@
+#ifndef _LIBCGROUP_ERROR_H
+#define _LIBCGROUP_ERROR_H
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+enum {
+ ECGROUPNOTCOMPILED = 50000,
+ ECGROUPNOTMOUNTED,
+ ECGROUPNOTEXIST,
+ ECGROUPNOTCREATED,
+ ECGROUPSUBSYSNOTMOUNTED,
+ ECGROUPNOTOWNER,
+ ECGROUPMULTIMOUNTED,/* Controllers bound to different mount points */
+ ECGROUPNOTALLOWED, /* This is the stock error. Default error. */
+ ECGMAXVALUESEXCEEDED,
+ ECGCONTROLLEREXISTS,
+ ECGVALUEEXISTS,
+ ECGINVAL,
+ ECGCONTROLLERCREATEFAILED,
+ ECGFAIL,
+ ECGROUPNOTINITIALIZED,
+ ECGROUPVALUENOTEXIST,
+ /* Represents error coming from other libraries like glibc. libcgroup
+ * users need to check errno upon encoutering ECGOTHER.
+ */
+ ECGOTHER, /* OS error, see errno */
+ ECGROUPNOTEQUAL,
+ ECGCONTROLLERNOTEQUAL,
+ ECGROUPPARSEFAIL, /* Failed to parse rules configuration file. */
+ ECGROUPNORULES, /* Rules list does not exist. */
+ ECGMOUNTFAIL,
+ ECGSENTINEL, /* Please insert further error codes above this */
+ ECGEOF, /* End of file, iterator */
+ ECGCONFIGPARSEFAIL,/* Failed to parse config file (cgconfig.conf). */
+ ECGNAMESPACEPATHS,
+ ECGNAMESPACECONTROLLER,
+ ECGMOUNTNAMESPACE,
+};
+
+#define ECGRULESPARSEFAIL ECGROUPPARSEFAIL
+
+/**
+ * Return error corresponding to @code in human readable format.
+ * @code: error code for which the corresponding error string is to be
+ * returned
+ */
+const char *cgroup_strerror(int code);
+
+/**
+ * Return last errno, which caused ECGOTHER error.
+ */
+int cgroup_get_last_errno();
+
+__END_DECLS
+
+#endif /* _LIBCGROUP_INIT_H */