Index: uspace/app/tester/vfs/vfs1.c
===================================================================
--- uspace/app/tester/vfs/vfs1.c	(revision 92688eb5e052b4e1edaa8977c435ab53dd50ca32)
+++ uspace/app/tester/vfs/vfs1.c	(revision 449c246f2fdcbdd111514fae0ec31618fb3c1080)
@@ -33,4 +33,6 @@
 #include <sys/types.h>
 #include <vfs.h>
+#include <unistd.h>
+#include <fcntl.h>
 #include "../tester.h"
 
Index: uspace/lib/libc/generic/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs.c	(revision 92688eb5e052b4e1edaa8977c435ab53dd50ca32)
+++ uspace/lib/libc/generic/vfs.c	(revision 449c246f2fdcbdd111514fae0ec31618fb3c1080)
@@ -34,4 +34,6 @@
  
 #include <vfs.h>
+#include <unistd.h>
+#include <fcntl.h>
 #include <ipc/ipc.h>
 #include <ipc/services.h>
@@ -141,5 +143,5 @@
 		}
 	}
-	req = async_send_1(vfs_phone, VFS_READ, 0, &answer);
+	req = async_send_1(vfs_phone, VFS_READ, fildes, &answer);
 	if (ipc_data_read_send(vfs_phone, buf, sizeof(buf)) != EOK) {
 		async_wait_for(req, NULL);
@@ -154,4 +156,33 @@
 }
 
+ssize_t write(int fildes, const void *buf, size_t nbyte) 
+{
+	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_WRITE, fildes, &answer);
+	if (ipc_data_write_send(vfs_phone, buf, sizeof(buf)) != EOK) {
+		async_wait_for(req, NULL);
+		async_serialize_end();
+		futex_up(&vfs_phone_futex);
+		return (ssize_t) rc;
+	}
+	async_wait_for(req, &rc);
+	async_serialize_end();
+	futex_up(&vfs_phone_futex);
+	return (ssize_t) IPC_GET_ARG1(answer);
+}
 /** @}
  */
Index: uspace/lib/libc/include/fcntl.h
===================================================================
--- uspace/lib/libc/include/fcntl.h	(revision 449c246f2fdcbdd111514fae0ec31618fb3c1080)
+++ uspace/lib/libc/include/fcntl.h	(revision 449c246f2fdcbdd111514fae0ec31618fb3c1080)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2007 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_FCNTL_H_
+#define LIBC_FCNTL_H_
+
+extern int open(const char *, int, ...);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/libc/include/vfs.h
===================================================================
--- uspace/lib/libc/include/vfs.h	(revision 92688eb5e052b4e1edaa8977c435ab53dd50ca32)
+++ uspace/lib/libc/include/vfs.h	(revision 449c246f2fdcbdd111514fae0ec31618fb3c1080)
@@ -36,9 +36,5 @@
 #define LIBC_VFS_H_
 
-#include <sys/types.h>
-
 extern int mount(const char *, const char *, const char *);
-extern int open(const char *, int, ...);
-extern ssize_t read(int, void *, size_t); 
 
 #endif
