[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2 20/23] lib/vfscore: add main constructor



Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
 lib/vfscore/main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index d7aba756..7accf931 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -2045,3 +2045,14 @@ int chroot(const char *path __unused)
        errno = ENOSYS;
        return -1;
 }
+
+static struct task _main_task_impl;
+__constructor static void vfscore_init(void)
+{
+       memset(&_main_task_impl, 0, sizeof(_main_task_impl));
+       strcpy(_main_task_impl.t_cwd, "/");
+       main_task = &_main_task_impl;
+
+       vnode_init();
+       lookup_init();
+}
-- 
2.19.2


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.