Index: uspace/lib/libc/generic/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs.c	(revision 5973fd0e3fba22d883e191eaf2eb0c640098d526)
+++ uspace/lib/libc/generic/vfs.c	(revision 4bb31f7fb268426f499400dc8b2d9f6c6d3aaf65)
@@ -96,6 +96,5 @@
 }
 
-
-int open(const char *path, int oflag, ...)
+static int _open(const char *path, int lflag, int oflag, ...)
 {
 	int res;
@@ -114,5 +113,5 @@
 		}
 	}
-	req = async_send_2(vfs_phone, VFS_OPEN, oflag, 0, &answer);
+	req = async_send_3(vfs_phone, VFS_OPEN, lflag, oflag, 0, &answer);
 	rc = ipc_data_write_start(vfs_phone, path, strlen(path));
 	if (rc != EOK) {
@@ -126,4 +125,9 @@
 	futex_up(&vfs_phone_futex);
 	return (int) IPC_GET_ARG1(answer);
+}
+
+int open(const char *path, int oflag, ...)
+{
+	return _open(path, L_FILE, oflag);
 }
 
@@ -243,5 +247,5 @@
 	if (!dirp)
 		return NULL;
-	dirp->fd = open(dirname, 0);	/* TODO: must be a directory */
+	dirp->fd = _open(dirname, L_DIRECTORY, 0);
 	if (dirp->fd < 0) {
 		free(dirp);
