summaryrefslogtreecommitdiff
path: root/euler/source
diff options
context:
space:
mode:
Diffstat (limited to 'euler/source')
-rw-r--r--euler/source/entry.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/euler/source/entry.cpp b/euler/source/entry.cpp
index ab721f1..b888027 100644
--- a/euler/source/entry.cpp
+++ b/euler/source/entry.cpp
@@ -2,28 +2,15 @@
#include <cstdlib>
#include <string>
-int main(int argc, char **argv);
+int main();
extern "C" [[noreturn]] void _start() {
//TODO: call static initializers
- auto argc_raw = euler::syscall::try_get_environment_variable("ARGC");
- int argc = argc_raw.has_value() ? std::stoi(argc_raw.value()) : 0;
+ int exit_code = main();
- std::vector<std::string> argv;
-
- for (int i = 0; i < argc; ++i) {
- std::string arg_name = std::string("ARGV") + std::to_string(i);
- auto arg_raw = euler::syscall::try_get_environment_variable(arg_name);
- argv.push_back(arg_raw.has_value() ? arg_raw.value() : "");
- }
-
- std::vector<char *> c_argv(argc);
- for (int i = 0; i < argc; ++i)
- c_argv[i] = argv[i].data();
-
- int exit_code = main(argc, c_argv.data());
+ //TODO: call at_exit stuff
euler::syscall::end_this_process(exit_code);