Index: uspace/lib/c/include/adt/hash_table.h
===================================================================
--- uspace/lib/c/include/adt/hash_table.h	(revision 8d6c1f139a0fd8ef52d018e1c68b0dcca5ec1ec9)
+++ uspace/lib/c/include/adt/hash_table.h	(revision 1029397040420ea0b52bc419fa0feadc8a35de9e)
@@ -75,5 +75,5 @@
 /** Hash table structure. */
 typedef struct {
-	link_t *entry;
+	list_t *entry;
 	hash_count_t entries;
 	hash_count_t max_keys;
Index: uspace/lib/c/include/adt/list.h
===================================================================
--- uspace/lib/c/include/adt/list.h	(revision 8d6c1f139a0fd8ef52d018e1c68b0dcca5ec1ec9)
+++ uspace/lib/c/include/adt/list.h	(revision 1029397040420ea0b52bc419fa0feadc8a35de9e)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2001-2004 Jakub Jermar
+ * Copyright (c) 2011 Jiri Svoboda
  * All rights reserved.
  *
@@ -36,7 +37,8 @@
 #define LIBC_LIST_H_
 
+#include <assert.h>
 #include <unistd.h>
 
-/** Doubly linked list head and link type. */
+/** Doubly linked list link. */
 typedef struct link {
 	struct link *prev;  /**< Pointer to the previous item in the list. */
@@ -44,4 +46,9 @@
 } link_t;
 
+/** Doubly linked list. */
+typedef struct list {
+	link_t head;  /**< List head. Does not have any data. */
+} list_t;
+
 /** Declare and initialize statically allocated list.
  *
@@ -50,7 +57,9 @@
  */
 #define LIST_INITIALIZE(name) \
-	link_t name = { \
-		.prev = &name, \
-		.next = &name \
+	list_t name = { \
+		.head = { \
+			.prev = &(name).head, \
+			.next = &(name).head \
+		} \
 	}
 
@@ -59,6 +68,9 @@
 
 #define list_foreach(list, iterator) \
-	for (link_t *iterator = (list).next; \
-	    iterator != &(list); iterator = iterator->next)
+	for (link_t *iterator = (list).head.next; \
+	    iterator != &(list).head; iterator = iterator->next)
+
+#define assert_link_not_used(link) \
+	assert((link)->prev == NULL && (link)->next == NULL)
 
 /** Initialize doubly-linked circular list link
@@ -79,11 +91,33 @@
  * Initialize doubly-linked circular list.
  *
- * @param list Pointer to link_t structure representing the list.
- *
- */
-static inline void list_initialize(link_t *list)
-{
-	list->prev = list;
-	list->next = list;
+ * @param list Pointer to list_t structure.
+ *
+ */
+static inline void list_initialize(list_t *list)
+{
+	list->head.prev = &list->head;
+	list->head.next = &list->head;
+}
+
+/** Insert item before another item in doubly-linked circular list.
+ *
+ */
+static inline void list_insert_before(link_t *lnew, link_t *lold)
+{
+	lnew->next = lold;
+	lnew->prev = lold->prev;
+	lold->prev->next = lnew;
+	lold->prev = lnew;
+}
+
+/** Insert item after another item in doubly-linked circular list.
+ *
+ */
+static inline void list_insert_after(link_t *lnew, link_t *lold)
+{
+	lnew->prev = lold;
+	lnew->next = lold->next;
+	lold->next->prev = lnew;
+	lold->next = lnew;
 }
 
@@ -93,13 +127,10 @@
  *
  * @param link Pointer to link_t structure to be added.
- * @param list Pointer to link_t structure representing the list.
- *
- */
-static inline void list_prepend(link_t *link, link_t *list)
-{
-	link->next = list->next;
-	link->prev = list;
-	list->next->prev = link;
-	list->next = link;
+ * @param list Pointer to list_t structure.
+ *
+ */
+static inline void list_prepend(link_t *link, list_t *list)
+{
+	list_insert_after(link, &list->head);
 }
 
@@ -109,29 +140,10 @@
  *
  * @param link Pointer to link_t structure to be added.
- * @param list Pointer to link_t structure representing the list.
- *
- */
-static inline void list_append(link_t *link, link_t *list)
-{
-	link->prev = list->prev;
-	link->next = list;
-	list->prev->next = link;
-	list->prev = link;
-}
-
-/** Insert item before another item in doubly-linked circular list.
- *
- */
-static inline void list_insert_before(link_t *link, link_t *list)
-{
-	list_append(link, list);
-}
-
-/** Insert item after another item in doubly-linked circular list.
- *
- */
-static inline void list_insert_after(link_t *link, link_t *list)
-{
-	list_prepend(list, link);
+ * @param list Pointer to list_t structure.
+ *
+ */
+static inline void list_append(link_t *link, list_t *list)
+{
+	list_insert_before(link, &list->head);
 }
 
@@ -155,15 +167,15 @@
  * Query emptiness of doubly-linked circular list.
  *
- * @param list Pointer to link_t structure representing the list.
- *
- */
-static inline int list_empty(link_t *list)
-{
-	return (list->next == list);
-}
-
-/** Get head item of a list.
- *
- * @param list Pointer to link_t structure representing the list.
+ * @param list Pointer to lins_t structure.
+ *
+ */
+static inline int list_empty(list_t *list)
+{
+	return (list->head.next == &list->head);
+}
+
+/** Get first item in list.
+ *
+ * @param list Pointer to list_t structure.
  *
  * @return Head item of the list.
@@ -171,7 +183,20 @@
  *
  */
-static inline link_t *list_head(link_t *list)
-{
-	return ((list->next == list) ? NULL : list->next);
+static inline link_t *list_first(list_t *list)
+{
+	return ((list->head.next == &list->head) ? NULL : list->head.next);
+}
+
+/** Get last item in list.
+ *
+ * @param list Pointer to list_t structure.
+ *
+ * @return Head item of the list.
+ * @return NULL if the list is empty.
+ *
+ */
+static inline link_t *list_last(list_t *list)
+{
+	return ((list->head.prev == &list->head) ? NULL : list->head.prev);
 }
 
@@ -230,5 +255,5 @@
 }
 
-/** Get n-th item of a list.
+/** Get n-th item in a list.
  *
  * @param list Pointer to link_t structure representing the list.
@@ -239,5 +264,5 @@
  *
  */
-static inline link_t *list_nth(link_t *list, unsigned int n)
+static inline link_t *list_nth(list_t *list, unsigned int n)
 {
 	unsigned int cnt = 0;
@@ -253,7 +278,7 @@
 }
 
-extern int list_member(const link_t *, const link_t *);
-extern void list_concat(link_t *, link_t *);
-extern unsigned int list_count(const link_t *);
+extern int list_member(const link_t *, const list_t *);
+extern void list_concat(list_t *, list_t *);
+extern unsigned int list_count(const list_t *);
 
 #endif
Index: uspace/lib/c/include/adt/prodcons.h
===================================================================
--- uspace/lib/c/include/adt/prodcons.h	(revision 8d6c1f139a0fd8ef52d018e1c68b0dcca5ec1ec9)
+++ uspace/lib/c/include/adt/prodcons.h	(revision 1029397040420ea0b52bc419fa0feadc8a35de9e)
@@ -42,5 +42,5 @@
 	fibril_mutex_t mtx;
 	fibril_condvar_t cv;
-	link_t list;
+	list_t list;
 } prodcons_t;
 
