diff options
Diffstat (limited to 'src/kernel/syscall/actions/sys_write.c')
-rw-r--r-- | src/kernel/syscall/actions/sys_write.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/syscall/actions/sys_write.c b/src/kernel/syscall/actions/sys_write.c index d79ef37..28a5929 100644 --- a/src/kernel/syscall/actions/sys_write.c +++ b/src/kernel/syscall/actions/sys_write.c @@ -3,20 +3,21 @@ #include <kernel/fs/ext2.h> #include <kernel/lib/stdlib.h> #include <kernel/memory/alloc.h> +#include <kernel/system.h> uint32_t sys_write(char *path, uint32_t offset, uint32_t count, char *buf) { struct fs_node *node = (struct fs_node *)umalloc(sizeof(struct fs_node)); strcpy(node->name, path); - ext2_root->open(node); + fs_open(node); if (node->inode != 0) { uint32_t size = ((struct ext2_file *)node->impl)->inode.size; - ext2_root->write(node, 0, size, buf); + fs_write(node, 0, size, buf); buf[size - 1] = '\0'; - ext2_root->close(node); + fs_close(node); return size; } else { - ext2_root->close(node); + fs_close(node); return -1; } }
\ No newline at end of file |