sysdeps/qword: Add __mlibc_entry function
This commit is contained in:
parent
13f9a920d5
commit
07cbe7215f
|
@ -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[])) {
|
||||
|
|
14
sysdeps/qword/generic/entry.cpp
Normal file
14
sysdeps/qword/generic/entry.cpp
Normal 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);
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ rtdl_sources += files(
|
|||
|
||||
libc_include_dirs += include_directories('include')
|
||||
libc_sources += files(
|
||||
'generic/entry.cpp',
|
||||
'generic/file.cpp'
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue