]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Add documentation to include/libcgroup/init.h
authorJan Safranek <jsafrane@redhat.com>
Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)
committerJan Safranek <jsafrane@redhat.com>
Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
include/libcgroup/init.h

index d0e93b4d6daa9cadfa2dfcdb9fed523789d6b2db..41eafcc246dc2b846d5e133cf774b00438661dd6 100644 (file)
@@ -9,17 +9,46 @@
 
 __BEGIN_DECLS
 
-/* Functions and structures that can be used by the application*/
+/**
+ * @defgroup group_init 1. Initialization
+ * @{
+ *
+ * @name Initialization
+ * @{
+ * Application must initialize @c libcgroup using cgroup_init() before any
+ * other @c libcgroup function can be called. @c libcgroup caches information
+ * about mounted hierarchies (just what's mounted where, not the control groups
+ * themselves) at this time. There is currently no way to refresh this cache,
+ * i.e. all subsequent mounts/remounts/unmounts are not reflected in this cache
+ * and @c libcgroup may produce unexpected results.
+ *
+ * In addition, there is no way how to clean the cache on application exit.
+ *
+ * @todo this is very bad... There should be at least way how to refresh the
+ * cache and/or an option to refresh it automatically (does kernel provide
+ * any indication, when a filesystem is mounted/unmounted?). Dtto the cleanup
+ * on exit.
+ */
+
+/**
+ * Initialize libcgroup. Information about mounted hierarchies are examined
+ * and cached internally (just what's mounted where, not the groups themselves).
+ */
 int cgroup_init(void);
 
-/*
- * Reads the mount to table to give the mount point of a controller
- * @controller: Name of the controller
- * @mount_point: The string where the mount point is stored. Please note,
- * the caller must free mount_point.
+/**
+ * Returns path where is mounted given controller. Applications should rely on
+ * @c libcgroup API and not call this function directly.
+ * @param controller Name of the controller
+ * @param mount_point The string where the mount point location is stored.
+ *     Please note, the caller must free the mount_point.
  */
 int cgroup_get_subsys_mount_point(const char *controller, char **mount_point);
 
+/**
+ * @}
+ * @}
+ */
 __END_DECLS
 
 #endif /* _LIBCGROUP_INIT_H */