diff options
Diffstat (limited to 'libcgroup.h')
-rw-r--r-- | libcgroup.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libcgroup.h b/libcgroup.h index 37bc888..dee4648 100644 --- a/libcgroup.h +++ b/libcgroup.h @@ -68,6 +68,11 @@ enum cgflags { CGFLAG_USECACHE = 0x01, }; +/** + * per thread errno variable, to be used when return code is ECGOTHER + */ +extern __thread int last_errno; + enum cgroup_errors { ECGROUPNOTCOMPILED=50000, ECGROUPNOTMOUNTED, @@ -88,7 +93,7 @@ enum cgroup_errors { /* Represents error coming from other libraries like glibc. libcgroup * users need to check errno upon encoutering ECGOTHER. */ - ECGOTHER, + ECGOTHER, /* OS error, see errno */ ECGROUPNOTEQUAL, ECGCONTROLLERNOTEQUAL, ECGROUPPARSEFAIL, /* Failed to parse rules configuration file. */ @@ -195,6 +200,12 @@ int cgroup_get_current_controller_path(pid_t pid, const char *controller, */ char *cgroup_strerror(int code); +/** + * Return last errno, which caused ECGOTHER error. + */ +int cgroup_get_last_errno(); + + /* The wrappers for filling libcg structures */ struct cgroup *cgroup_new_cgroup(const char *name); |