scripts/init.d/cgred
samples/Makefile
include/Makefile
+ include/libcgroup/init.h
doc/Makefile
doc/man/Makefile
dist/Makefile
const struct cgroup * const in_cgroup,
enum cg_version_t in_version);
+/**
+ * Get the cgroup version of a controller. Version is set to CGROUP_UNK
+ * if the version cannot be determined.
+ *
+ * @param controller The controller of interest
+ * @param version The version of the controller
+ */
+int cgroup_get_controller_version(const char * const controller,
+ enum cg_version_t * const version);
+
/**
* @}
* @}
extern "C" {
#endif
+#define CGROUP_VER_MAJOR @LIBRARY_VERSION_MAJOR@
+#define CGROUP_VER_MINOR @LIBRARY_VERSION_MINOR@
+#define CGROUP_VER_RELEASE @LIBRARY_VERSION_RELEASE@
+
+struct cgroup_library_version {
+ unsigned int major;
+ unsigned int minor;
+ unsigned int release;
+};
+
+/**
+ * Query the library version information
+ *
+ * This function returns a pointer to a populated cgroup_library_version
+ * struct. The caller does not need to free the structure when finished.
+ *
+ */
+const struct cgroup_library_version *cgroup_version(void);
+
/**
* @defgroup group_init 1. Initialization
* @{
#include <linux/un.h>
#include <grp.h>
+const struct cgroup_library_version library_version = {
+ .major = CGROUP_VER_MAJOR,
+ .minor = CGROUP_VER_MINOR,
+ .release = CGROUP_VER_RELEASE,
+};
+
/*
* The errno which happend the last time (have to be thread specific)
*/
return ECGROUPNOTEXIST;
}
+
+const struct cgroup_library_version *cgroup_version(void)
+{
+ return &library_version;
+}
*/
int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
-/**
- * Get the cgroup version of a controller. Version is set to CGROUP_UNK
- * if the version cannot be determined.
- *
- * @param controller The controller of interest
- * @param version The version of the controller
- */
-int cgroup_get_controller_version(const char * const controller,
- enum cg_version_t * const version);
-
/**
* Build the path to the tasks or cgroup.procs file
*
cgroup_convert_cgroup;
cgroup_cgxget;
cgroup_cgxset;
+ cgroup_version;
} CGROUP_2.0;