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

[Minios-devel] [UNIKRAFT PATCH 19/22] 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 16ea0015..74bd779f 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -2049,3 +2049,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®.