sysdeps/qword: Add __mlibc_entry function

This commit is contained in:
Alexander van der Grinten 2018-11-21 18:24:07 +01:00
parent 13f9a920d5
commit 07cbe7215f
3 changed files with 16 additions and 1 deletions

View file

@ -80,7 +80,7 @@ LibraryGuard::LibraryGuard() {
}
}
// The environmet was build by the LibraryGuard.
// The environment was build by the LibraryGuard.
extern char **environ;
extern "C" void __mlibc_entry(int (*main_function)(int argc, char *argv[], char *env[])) {

View file

@ -0,0 +1,14 @@
#include <stdlib.h>
// TODO: Fill this as we do in managarm.
static int __mlibc_argc;
static char **__mlibc_argv;
extern char **environ;
extern "C" void __mlibc_entry(int (*main_function)(int argc, char *argv[], char *env[])) {
auto result = main_function(__mlibc_argc, __mlibc_argv, environ);
exit(result);
}

View file

@ -9,6 +9,7 @@ rtdl_sources += files(
libc_include_dirs += include_directories('include')
libc_sources += files(
'generic/entry.cpp',
'generic/file.cpp'
)