feat: fstat now handle symbolic link
[lunaix-os.git] / lunaix-os / kernel / process / taskfs.c
index 28c371346478a5cb83922e35662ccb3246eee4ef..36ed5ee28d52aef1f8a6f84e627a278bbb3a2575 100644 (file)
@@ -1,4 +1,3 @@
-#include <lunaix/dirent.h>
 #include <lunaix/fs/taskfs.h>
 #include <lunaix/fs/twimap.h>
 #include <lunaix/mm/valloc.h>
@@ -8,6 +7,8 @@
 #include <klibc/stdio.h>
 #include <klibc/string.h>
 
+#include <usr/lunaix/dirent_defs.h>
+
 #define COUNTER_MASK ((1 << 16) - 1)
 
 static struct hbucket* attr_export_table;
@@ -128,12 +129,14 @@ taskfs_dirlookup(struct v_inode* this, struct v_dnode* dnode)
         return ENOENT;
     }
 
-    return taskfs_mknod(dnode, pid, 0, VFS_IFDIR);
+    return taskfs_mknod(dnode, pid, 0, F_FILE);
 }
 
 static struct v_file_ops taskfs_file_ops = { .close = default_file_close,
                                              .read = default_file_read,
+                                             .read_page = default_file_read,
                                              .write = default_file_write,
+                                             .write_page = default_file_write,
                                              .readdir = taskfs_readdir,
                                              .seek = default_file_seek };
 static struct v_inode_ops taskfs_inode_ops = { .dir_lookup = taskfs_dirlookup,
@@ -223,4 +226,5 @@ taskfs_init()
     attr_export_table = vcalloc(ATTR_TABLE_LEN, sizeof(struct hbucket));
 
     export_task_attr();
-}
\ No newline at end of file
+}
+EXPORT_FILE_SYSTEM(taskfs, taskfs_init);
\ No newline at end of file