Index: uspace/srv/devman/Makefile
===================================================================
--- uspace/srv/devman/Makefile	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/Makefile	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -29,7 +29,5 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBC_PREFIX)/libc.a
-
-OUTPUT = devman
+BINARY = devman
 
 SOURCES = \
@@ -39,3 +37,3 @@
 	util.c
 
-include ../Makefile.common
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/devman.c	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -38,5 +38,4 @@
 
 #include "devman.h"
-#include "util.h"
 
 /** Allocate and initialize a new driver structure.
@@ -74,5 +73,5 @@
  * @return the match id. 
  */
-char * read_match_id(const char **buf) 
+char * read_match_id(char **buf) 
 {
 	char *res = NULL;
@@ -100,5 +99,5 @@
  * @return true if at least one match id and associated match score was successfully read, false otherwise.
  */
-bool parse_match_ids(const char *buf, match_id_list_t *ids)
+bool parse_match_ids(char *buf, match_id_list_t *ids)
 {
 	int score = 0;
@@ -158,5 +157,5 @@
 	bool opened = false;
 	int fd;		
-	off_t len = 0;
+	size_t len = 0;
 	
 	fd = open(conf_path, O_RDONLY);
@@ -315,8 +314,8 @@
 	printf(NAME ": create_root_node\n");
 	node_t *node = create_dev_node();
-	if (node) {
-		insert_dev_node(tree, node, "", NULL);
+	if (node) {		
+		insert_dev_node(tree, node, clone_string(""), NULL);
 		match_id_t *id = create_match_id();
-		id->id = "root";
+		id->id = clone_string("root");
 		id->score = 100;
 		add_match_id(&node->match_ids, id);
@@ -392,11 +391,12 @@
 	printf(NAME ": start_driver '%s'\n", drv->name);
 	
-	char *argv[2];
+	const char *argv[2];
 	
 	argv[0] = drv->name;
 	argv[1] = NULL;
 	
-	if (!task_spawn(drv->binary_path, argv)) {
-		printf(NAME ": error spawning %s\n", drv->name);
+	int err;
+	if (!task_spawn(drv->binary_path, argv, &err)) {
+		printf(NAME ": error spawning %s, errno = %d\n", drv->name, err);
 		return false;
 	}
@@ -682,5 +682,4 @@
 	char *rel_path = path;
 	char *next_path_elem = NULL;
-	size_t elem_size = 0;
 	bool cont = '/' == rel_path[0];
 	
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/devman.h	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -37,5 +37,5 @@
 #include <bool.h>
 #include <dirent.h>
-#include <string.h>
+#include <str.h>
 #include <adt/list.h>
 #include <ipc/ipc.h>
@@ -145,7 +145,8 @@
 int get_match_score(driver_t *drv, node_t *dev);
 
-bool parse_match_ids(const char *buf, match_id_list_t *ids);
+bool parse_match_ids(char *buf, match_id_list_t *ids);
 bool read_match_ids(const char *conf_path, match_id_list_t *ids);
-char * read_id(const char **buf) ;
+char * read_match_id(char **buf);
+char * read_id(const char **buf);
 
 // Drivers
@@ -165,5 +166,5 @@
 }
 
-driver_t * create_driver();
+driver_t * create_driver(void);
 bool get_driver_info(const char *base_path, const char *name, driver_t *drv);
 int lookup_available_drivers(driver_list_t *drivers_list, const char *dir_path);
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/main.c	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -45,5 +45,5 @@
 #include <fibril_synch.h>
 #include <stdlib.h>
-#include <string.h>
+#include <str.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -60,4 +60,53 @@
 static driver_list_t drivers_list;
 static dev_tree_t device_tree;
+
+/** Wrapper for receiving strings
+ *
+ * This wrapper only makes it more comfortable to use async_data_write_*
+ * functions to receive strings.
+ *
+ * @param str      Pointer to string pointer (which should be later disposed
+ *                 by free()). If the operation fails, the pointer is not
+ *                 touched.
+ * @param max_size Maximum size (in bytes) of the string to receive. 0 means
+ *                 no limit.
+ * @param received If not NULL, the size of the received data is stored here.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
+ */
+static int async_string_receive(char **str, const size_t max_size, size_t *received)
+{
+        ipc_callid_t callid;
+        size_t size;
+        if (!async_data_write_receive(&callid, &size)) {
+                ipc_answer_0(callid, EINVAL);
+                return EINVAL;
+        }
+        
+        if ((max_size > 0) && (size > max_size)) {
+                ipc_answer_0(callid, EINVAL);
+                return EINVAL;
+        }
+        
+        char *data = (char *) malloc(size + 1);
+        if (data == NULL) {
+                ipc_answer_0(callid, ENOMEM);
+                return ENOMEM;
+        }
+        
+        int rc = async_data_write_finalize(callid, data, size);
+        if (rc != EOK) {
+                free(data);
+                return rc;
+        }
+        
+        data[size] = 0;
+        *str = data;
+        if (received != NULL)
+                *received = size;
+        
+        return EOK;
+}
 
 /**
@@ -155,5 +204,7 @@
 	match_id->score = IPC_GET_ARG1(call);
 	
-	rc = async_string_receive(&match_id->id, DEVMAN_NAME_MAXLEN, NULL);	
+	char *match_id_str;
+	rc = async_string_receive(&match_id_str, DEVMAN_NAME_MAXLEN, NULL);	
+	match_id->id = match_id_str;
 	if (EOK != rc) {
 		delete_match_id(match_id);
Index: uspace/srv/devman/match.c
===================================================================
--- uspace/srv/devman/match.c	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/match.c	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -32,5 +32,5 @@
  
  
-#include <string.h>
+#include <str.h>
 
 #include "devman.h"
Index: uspace/srv/devman/util.c
===================================================================
--- uspace/srv/devman/util.c	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/util.c	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -32,5 +32,5 @@
 
 #include <stdlib.h>
-#include <string.h> 
+#include <str.h> 
  
 #include "util.h"
@@ -62,5 +62,5 @@
 }
 
-const char * get_path_elem_end(const char *path)
+char * get_path_elem_end(char *path)
 {
 	while (0 != *path && '/' != *path) {
Index: uspace/srv/devman/util.h
===================================================================
--- uspace/srv/devman/util.h	(revision 04c7003fb172cc2f72856676541c76663afa21aa)
+++ uspace/srv/devman/util.h	(revision c47e1a8fb8e2a2556518fd57f186595422ca4484)
@@ -35,10 +35,12 @@
 
 #include <ctype.h>
+#include <str.h>
+#include <malloc.h>
 
 
 char * get_abs_path(const char *base_path, const char *name, const char *ext);
-const char * get_path_elem_end(const char *path);
+char * get_path_elem_end(char *path);
 
-static inline bool skip_spaces(const char **buf) 
+static inline bool skip_spaces(char **buf) 
 {
 	while (isspace(**buf)) {
@@ -65,3 +67,13 @@
 }
 
+static inline char * clone_string(const char *s) 
+{
+	size_t size = str_size(s) + 1;
+	char *str = (char *)malloc(size);
+	if (NULL != str) {
+		str_cpy(str, size, s);
+	}
+	return str;
+}
+
 #endif
