Index: uspace/lib/libc/generic/libadt/list.c
===================================================================
--- uspace/lib/libc/generic/libadt/list.c	(revision 55982d604625d696854130424f05ca9461b09887)
+++ uspace/lib/libc/generic/libadt/list.c	(revision 2246de644f7ce21502763784228e70ae8aa2aa3f)
@@ -49,10 +49,10 @@
 int list_member(const link_t *link, const link_t *head)
 {
-	int found = false;
+	int found = 0;
 	link_t *hlp = head->next;
 	
 	while (hlp != head) {
 		if (hlp == link) {
-			found = true;
+			found = 1;
 			break;
 		}
@@ -78,7 +78,7 @@
 	if (list_empty(head2))
 		return;
-
+	
 	head2->next->prev = head1->prev;
-	head2->prev->next = head1;	
+	head2->prev->next = head1;
 	head1->prev->next = head2->next;
 	head1->prev = head2->prev;
@@ -86,4 +86,27 @@
 }
 
+
+/** Count list items
+ *
+ * Return the number of items in the list.
+ *
+ * @param link List to count.
+ *
+ * @return Number of items in the list.
+ *
+ */
+unsigned int list_count(const link_t *link)
+{
+	unsigned int count = 0;
+	link_t *hlp = link->next;
+	
+	while (hlp != link) {
+		count++;
+		hlp = hlp->next;
+	}
+	
+	return count;
+}
+
 /** @}
  */
Index: uspace/lib/libc/include/libadt/list.h
===================================================================
--- uspace/lib/libc/include/libadt/list.h	(revision 55982d604625d696854130424f05ca9461b09887)
+++ uspace/lib/libc/include/libadt/list.h	(revision 2246de644f7ce21502763784228e70ae8aa2aa3f)
@@ -38,18 +38,9 @@
 #include <unistd.h>
 
-#ifndef true
-# define true 1
-#endif
-#ifndef false
-# define false 0
-#endif
-
-typedef struct link link_t;
-
 /** Doubly linked list head and link type. */
-struct link {
-	link_t *prev;	/**< Pointer to the previous item in the list. */
-	link_t *next;	/**< Pointer to the next item in the list. */
-};
+typedef struct link {
+	struct link *prev;  /**< Pointer to the previous item in the list. */
+	struct link *next;  /**< Pointer to the next item in the list. */
+} link_t;
 
 /** Declare and initialize statically allocated list.
@@ -57,5 +48,8 @@
  * @param name Name of the new statically allocated list.
  */
-#define LIST_INITIALIZE(name)		link_t name = { .prev = &name, .next = &name }
+#define LIST_INITIALIZE(name)  link_t name = { \
+	.prev = &name, \
+	.next = &name \
+}
 
 /** Initialize doubly-linked circular list link
@@ -146,5 +140,5 @@
 static inline int list_empty(link_t *head)
 {
-	return head->next == head ? true : false;
+	return ((head->next == head) ? 1 : 0);
 }
 
@@ -162,9 +156,9 @@
 static inline void headless_list_split_or_concat(link_t *part1, link_t *part2)
 {
-	link_t *hlp;
-
 	part1->prev->next = part2;
-	part2->prev->next = part1;	
-	hlp = part1->prev;
+	part2->prev->next = part1;
+	
+	link_t *hlp = part1->prev;
+	
 	part1->prev = part2->prev;
 	part2->prev = hlp;
@@ -196,8 +190,9 @@
 }
 
-#define list_get_instance(link,type,member) (type *)(((char *)(link))-((char *)&(((type *)NULL)->member)))
+#define list_get_instance(link, type, member)  ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member))))
 
 extern int list_member(const link_t *link, const link_t *head);
 extern void list_concat(link_t *head1, link_t *head2);
+extern unsigned int list_count(const link_t *link);
 
 #endif
