Index: uspace/lib/libc/generic/device/char.c
===================================================================
--- uspace/lib/libc/generic/device/char.c	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libc/generic/device/char.c	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -38,4 +38,5 @@
 #include <async.h>
 #include <malloc.h>
+#include <stdio.h>
 
 
@@ -46,4 +47,5 @@
 	async_serialize_start();
 	
+	printf("calling interface %d\n", DEV_IFACE_ID(CHAR_DEV_IFACE));
 	aid_t req = async_send_1(dev_phone, DEV_IFACE_ID(CHAR_DEV_IFACE), CHAR_READ_DEV, &answer);
 	
Index: uspace/lib/libc/generic/devman.c
===================================================================
--- uspace/lib/libc/generic/devman.c	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libc/generic/devman.c	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -230,4 +230,41 @@
 }
 
+int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags)
+{
+	int phone = devman_get_phone(DEVMAN_CLIENT, flags);
+	
+	if (phone < 0)
+		return phone;
+	
+	async_serialize_start();
+	
+	ipc_call_t answer;
+	aid_t req = async_send_2(phone, DEVMAN_DEVICE_GET_HANDLE, flags, 0,
+	    &answer);
+	
+	ipcarg_t retval = async_data_write_start(phone, pathname, str_size(pathname));
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		async_serialize_end();
+		return retval;
+	}
+	
+	async_wait_for(req, &retval);
+	
+	async_serialize_end();
+	
+	if (retval != EOK) {
+		if (handle != NULL)
+			*handle = (device_handle_t) -1;
+		return retval;
+	}
+	
+	if (handle != NULL)
+		*handle = (device_handle_t) IPC_GET_ARG1(answer);
+	
+	return retval;
+}
+
+
 /** @}
  */
Index: uspace/lib/libc/include/devman.h
===================================================================
--- uspace/lib/libc/include/devman.h	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libc/include/devman.h	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -51,4 +51,6 @@
 int devman_parent_device_connect(device_handle_t handle, unsigned int flags);
 
+int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags);
+
 
 #endif
Index: uspace/lib/libc/include/ipc/devman.h
===================================================================
--- uspace/lib/libc/include/ipc/devman.h	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libc/include/ipc/devman.h	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -138,4 +138,8 @@
 } devman_to_driver_t;
 
+typedef enum {
+	DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD
+} client_to_devman_t;
+
 #endif
 
Index: uspace/lib/libdrv/generic/driver.c
===================================================================
--- uspace/lib/libdrv/generic/driver.c	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libdrv/generic/driver.c	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -254,5 +254,5 @@
 			if (!is_valid_iface_idx(iface_idx)) {
 				// this is not device's interface
-				printf("%s: driver_connection_gen error - invalid interface id %x.", driver->name, method);
+				printf("%s: driver_connection_gen error - invalid interface id %d.", driver->name, iface_idx);
 				ipc_answer_0(callid, ENOTSUP);
 				break;
@@ -265,5 +265,5 @@
 			if (NULL == iface) {
 				printf("%s: driver_connection_gen error - ", driver->name);
-				printf("device with handle %x has no interface with id %x.\n", handle, method);
+				printf("device with handle %d has no interface with id %d.\n", handle, iface_idx);
 				ipc_answer_0(callid, ENOTSUP);
 				break;
Index: uspace/lib/libdrv/generic/remote_char.c
===================================================================
--- uspace/lib/libdrv/generic/remote_char.c	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libdrv/generic/remote_char.c	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -56,14 +56,17 @@
 
 static void remote_char_read(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call)
-{
+{	
 	char_iface_t *char_iface = (char_iface_t *)iface;
-	if (!char_iface->read) {
-		ipc_answer_0(callid, ENOTSUP);
-		return;
-	}
 	
 	size_t len;
 	if (!async_data_read_receive(&callid, &len)) {
 		// TODO handle protocol error
+		ipc_answer_0(callid, EINVAL);
+		return;
+	}
+	
+	if (!char_iface->read) {
+		async_data_read_finalize(callid, NULL, 0);
+		ipc_answer_0(callid, ENOTSUP);
 		return;
 	}
Index: uspace/lib/libdrv/include/driver.h
===================================================================
--- uspace/lib/libdrv/include/driver.h	(revision 25a7e11d68ec284b83b483e3d4e486419ef52218)
+++ uspace/lib/libdrv/include/driver.h	(revision f6584584155369fb64be36eb3432e8a2081ac094)
@@ -163,5 +163,7 @@
 {
 	assert(is_valid_iface_idx(idx));	
-
+	if (NULL == dev->class) {
+		return NULL;
+	}
 	return dev->class->interfaces[idx];	
 }
