Index: uspace/lib/libc/generic/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs.c	(revision e7045039e22decbd208b7b85570324c5de0c9301)
+++ uspace/lib/libc/generic/vfs.c	(revision 343dc9e3aefbe27389e36a69d1d7829327a7e06c)
@@ -311,18 +311,17 @@
 	int res;
 	ipcarg_t rc;
-	ipc_call_t answer;
-	aid_t req;
-	
-	futex_down(&vfs_phone_futex);
-	async_serialize_start();
-	if (vfs_phone < 0) {
-		res = vfs_connect();
-		if (res < 0) {
-			async_serialize_end();
-			futex_up(&vfs_phone_futex);
-			return res;
-		}
-	}
-	req = async_send_1(vfs_phone, VFS_MKDIR, mode, &answer);
+	aid_t req;
+	
+	futex_down(&vfs_phone_futex);
+	async_serialize_start();
+	if (vfs_phone < 0) {
+		res = vfs_connect();
+		if (res < 0) {
+			async_serialize_end();
+			futex_up(&vfs_phone_futex);
+			return res;
+		}
+	}
+	req = async_send_1(vfs_phone, VFS_MKDIR, mode, NULL);
 	rc = ipc_data_write_start(vfs_phone, path, strlen(path));
 	if (rc != EOK) {
@@ -336,4 +335,44 @@
 	futex_up(&vfs_phone_futex);
 	return EOK; 
+}
+
+static int _unlink(const char *path, int lflag)
+{
+	int res;
+	ipcarg_t rc;
+	aid_t req;
+	
+	futex_down(&vfs_phone_futex);
+	async_serialize_start();
+	if (vfs_phone < 0) {
+		res = vfs_connect();
+		if (res < 0) {
+			async_serialize_end();
+			futex_up(&vfs_phone_futex);
+			return res;
+		}
+	}
+	req = async_send_0(vfs_phone, VFS_UNLINK, NULL);
+	rc = ipc_data_write_start(vfs_phone, path, strlen(path));
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		async_serialize_end();
+		futex_up(&vfs_phone_futex);
+		return (int) rc;
+	}
+	async_wait_for(req, &rc);
+	async_serialize_end();
+	futex_up(&vfs_phone_futex);
+	return EOK; 
+}
+
+int unlink(const char *path)
+{
+	return _unlink(path, L_NONE);
+}
+
+int rmdir(const char *path)
+{
+	return _unlink(path, L_DIRECTORY);
 }
 
