Index: uspace/lib/libc/generic/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs.c	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
+++ uspace/lib/libc/generic/vfs.c	(revision e7045039e22decbd208b7b85570324c5de0c9301)
@@ -136,5 +136,24 @@
 int close(int fildes)
 {
-	return 0;	/* TODO */
+	int res;
+	ipcarg_t rc;
+
+	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;
+		}
+	}
+		
+	rc = async_req_1_0(vfs_phone, VFS_CLOSE, fildes);
+
+	async_serialize_end();
+	futex_up(&vfs_phone_futex);
+	
+	return (int)rc;
 }
 
Index: uspace/lib/libc/include/errno.h
===================================================================
--- uspace/lib/libc/include/errno.h	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
+++ uspace/lib/libc/include/errno.h	(revision e7045039e22decbd208b7b85570324c5de0c9301)
@@ -44,4 +44,5 @@
 #define EEXIST		(-260)
 #define ENOTEMPTY	(-261)
+#define EBADF		(-262)
 
 #endif
Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
+++ uspace/srv/vfs/vfs.c	(revision e7045039e22decbd208b7b85570324c5de0c9301)
@@ -94,4 +94,7 @@
 			vfs_open(callid, &call);
 			break;
+		case VFS_CLOSE:
+			vfs_close(callid, &call);
+			break;
 		case VFS_READ:
 			vfs_read(callid, &call);
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
+++ uspace/srv/vfs/vfs.h	(revision e7045039e22decbd208b7b85570324c5de0c9301)
@@ -270,4 +270,5 @@
 extern void vfs_mount(ipc_callid_t, ipc_call_t *);
 extern void vfs_open(ipc_callid_t, ipc_call_t *);
+extern void vfs_close(ipc_callid_t, ipc_call_t *);
 extern void vfs_read(ipc_callid_t, ipc_call_t *);
 extern void vfs_write(ipc_callid_t, ipc_call_t *);
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
+++ uspace/srv/vfs/vfs_ops.c	(revision e7045039e22decbd208b7b85570324c5de0c9301)
@@ -388,4 +388,15 @@
 }
 
+void vfs_close(ipc_callid_t rid, ipc_call_t *request)
+{
+	int fd = IPC_GET_ARG1(*request);
+	if (fd >= MAX_OPEN_FILES) {
+		ipc_answer_0(rid, EBADF);
+		return;
+	}
+	vfs_fd_free(fd);
+	ipc_answer_0(rid, EOK);
+}
+
 static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read)
 {
