summaryrefslogtreecommitdiff
path: root/src/user/app/init
diff options
context:
space:
mode:
authordzwdz2022-08-05 15:54:32 +0200
committerdzwdz2022-08-05 15:54:32 +0200
commit99e15199ef24d4f262683b47a529f1b239c4dcd9 (patch)
tree7d4514964c91fc1c46da39cb830fdec165166730 /src/user/app/init
parent0f3c70649a3d8035b0c0f9658705505948b2c60a (diff)
add _syscall_getsize
Diffstat (limited to 'src/user/app/init')
-rw-r--r--src/user/app/init/driver/tmpfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/user/app/init/driver/tmpfs.c b/src/user/app/init/driver/tmpfs.c
index 96fdf39..7414320 100644
--- a/src/user/app/init/driver/tmpfs.c
+++ b/src/user/app/init/driver/tmpfs.c
@@ -15,7 +15,9 @@ struct node {
};
struct node *root = NULL;
-static struct node special_root;
+static struct node special_root = {
+ .size = 0,
+};
static struct node *lookup(const char *path, size_t len) {
for (struct node *iter = root; iter; iter = iter->next) {
@@ -109,6 +111,11 @@ void tmpfs_drv(void) {
_syscall_fs_respond(NULL, res.len, 0);
break;
+ case VFSOP_GETSIZE:
+ ptr = (void*)res.id;
+ _syscall_fs_respond(NULL, ptr->size, 0);
+ break;
+
default:
_syscall_fs_respond(NULL, -1, 0);
break;