Index: uspace/lib/libc/generic/vfs/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs/vfs.c	(revision 923c39ef88449c3bf5f20c07c2f7976b7c01ec22)
+++ uspace/lib/libc/generic/vfs/vfs.c	(revision 271b5400c010d0eec9cf6495d6f78b10d98a17a2)
@@ -49,4 +49,5 @@
 #include <errno.h>
 #include <string.h>
+#include <ipc/devmap.h>
 #include "../../srv/vfs/vfs.h"
 
@@ -103,4 +104,36 @@
 }
 
+static int device_get_handle(char *name, dev_handle_t *handle)
+{
+	int phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, DEVMAP_CLIENT, 0);
+	if (phone < 0)
+		return phone;
+	
+	ipc_call_t answer;
+	aid_t req = async_send_2(phone, DEVMAP_DEVICE_GET_HANDLE, 0, 0,
+	    &answer);
+	
+	ipcarg_t retval = ipc_data_write_start(phone, name, strlen(name) + 1); 
+
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		ipc_hangup(phone);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+
+	if (handle != NULL)
+		*handle = -1;
+	
+	if (retval == EOK) {
+		if (handle != NULL)
+			*handle = (dev_handle_t) IPC_GET_ARG1(answer);
+	}
+	
+	ipc_hangup(phone);
+	return retval;
+}
+
 int mount(const char *fs_name, const char *mp, const char *dev)
 {
@@ -108,7 +141,10 @@
 	ipcarg_t rc;
 	aid_t req;
-
-	dev_handle_t dev_handle = 0;	/* TODO */
-
+	dev_handle_t dev_handle;
+	
+	res = device_get_handle(dev, &dev_handle);
+	if (res != EOK)
+		return res;
+	
 	size_t mpa_len;
 	char *mpa = absolutize(mp, &mpa_len);
