Index: uspace/lib/c/generic/stats.c
===================================================================
--- uspace/lib/c/generic/stats.c	(revision 9dae191e774f517d5430fc726e4aef5787b1fcd0)
+++ uspace/lib/c/generic/stats.c	(revision d8693989d41da5cff2a9dc07daabd16136877a67)
@@ -43,4 +43,13 @@
 #define SYSINFO_STATS_MAX_PATH  64
 
+/** Get CPUs statistics
+ *
+ * @param count Number of records returned.
+ *
+ * @return Array of stats_cpu_t structures.
+ *         If non-NULL then it should be eventually freed
+ *         by free().
+ *
+ */
 stats_cpu_t *get_stats_cpus(size_t *count)
 {
@@ -55,4 +64,12 @@
 }
 
+/** Get physical memory statistics
+ *
+ *
+ * @return Pointer to the stats_physmem_t structure.
+ *         If non-NULL then it should be eventually freed
+ *         by free().
+ *
+ */
 stats_physmem_t *get_stats_physmem(void)
 {
@@ -66,4 +83,13 @@
 }
 
+/** Get task IDs
+ *
+ * @param count Number of IDs returned.
+ *
+ * @return Array of IDs (task_id_t).
+ *         If non-NULL then it should be eventually freed
+ *         by free().
+ *
+ */
 task_id_t *get_stats_tasks(size_t *count)
 {
@@ -78,4 +104,13 @@
 }
 
+/** Get single task statistics
+ *
+ * @param task_id Task ID we are interested in.
+ *
+ * @return Pointer to the stats_task_t structure.
+ *         If non-NULL then it should be eventually freed
+ *         by free().
+ *
+ */
 stats_task_t *get_stats_task(task_id_t task_id)
 {
@@ -92,4 +127,13 @@
 }
 
+/** Get system load
+ *
+ * @param count Number of load records returned.
+ *
+ * @return Array of load records (load_t).
+ *         If non-NULL then it should be eventually freed
+ *         by free().
+ *
+ */
 load_t *get_stats_load(size_t *count)
 {
@@ -104,4 +148,9 @@
 }
 
+/** Get system uptime
+ *
+ * @return System uptime (in seconds).
+ *
+ */
 sysarg_t get_stats_uptime(void)
 {
@@ -113,4 +162,13 @@
 }
 
+/** Print load fixed-point value
+ *
+ * Print the load record fixed-point value in decimal
+ * representation on stdout.
+ *
+ * @param upper      Load record.
+ * @param dec_length Number of decimal digits to print.
+ *
+ */
 void print_load_fragment(load_t upper, unsigned int dec_length)
 {
Index: uspace/lib/c/generic/sysinfo.c
===================================================================
--- uspace/lib/c/generic/sysinfo.c	(revision 9dae191e774f517d5430fc726e4aef5787b1fcd0)
+++ uspace/lib/c/generic/sysinfo.c	(revision d8693989d41da5cff2a9dc07daabd16136877a67)
@@ -40,4 +40,11 @@
 #include <bool.h>
 
+/** Get sysinfo item type
+ *
+ * @param path Sysinfo path.
+ *
+ * @return Sysinfo item type.
+ *
+ */
 sysinfo_item_tag_t sysinfo_get_tag(const char *path)
 {
@@ -46,4 +53,13 @@
 }
 
+/** Get sysinfo numerical value
+ *
+ * @param path  Sysinfo path.
+ * @param value Pointer to store the numerical value to.
+ *
+ * @return EOK if the value was successfully read and
+ *         is of SYSINFO_VAL_VAL type.
+ *
+ */
 int sysinfo_get_value(const char *path, sysarg_t *value)
 {
@@ -52,4 +68,13 @@
 }
 
+/** Get sysinfo binary data size
+ *
+ * @param path  Sysinfo path.
+ * @param value Pointer to store the binary data size.
+ *
+ * @return EOK if the value was successfully read and
+ *         is of SYSINFO_VAL_DATA type.
+ *
+ */
 static int sysinfo_get_data_size(const char *path, size_t *size)
 {
@@ -58,10 +83,31 @@
 }
 
+/** Get sysinfo binary data
+ *
+ * @param path  Sysinfo path.
+ * @param value Pointer to store the binary data size.
+ *
+ * @return Binary data read from sysinfo or NULL if the
+ *         sysinfo item value type is not binary data.
+ *         The returned non-NULL pointer should be
+ *         freed by free().
+ *
+ */
 void *sysinfo_get_data(const char *path, size_t *size)
 {
+	/* The binary data size might change during time.
+	   Unfortunatelly we cannot allocate the buffer
+	   and transfer the data as a single atomic operation.
+	
+	   Let's hope that the number of iterations is bounded
+	   in common cases. */
+	
 	while (true) {
+		/* Get the binary data size */
 		int ret = sysinfo_get_data_size(path, size);
-		if (ret != EOK)
+		if (ret != EOK) {
+			/* Not binary data item */
 			return NULL;
+		}
 		
 		void *data = malloc(*size);
@@ -69,4 +115,5 @@
 			return NULL;
 		
+		/* Get the data */
 		ret = __SYSCALL4(SYS_SYSINFO_GET_DATA, (sysarg_t) path,
 		    (sysarg_t) str_size(path), (sysarg_t) data, (sysarg_t) *size);
@@ -74,8 +121,12 @@
 			return data;
 		
+		/* Dispose the buffer */
 		free(data);
 		
-		if (ret != ENOMEM)
+		if (ret != ENOMEM) {
+			/* The failure to get the data was not caused
+			   by wrong buffer size */
 			return NULL;
+		}
 	}
 }
Index: uspace/lib/c/include/sysinfo.h
===================================================================
--- uspace/lib/c/include/sysinfo.h	(revision 9dae191e774f517d5430fc726e4aef5787b1fcd0)
+++ uspace/lib/c/include/sysinfo.h	(revision d8693989d41da5cff2a9dc07daabd16136877a67)
@@ -38,4 +38,7 @@
 #include <libc.h>
 
+/** Sysinfo value types
+ *
+ */
 typedef enum {
 	SYSINFO_VAL_UNDEFINED = 0,
