From e6915fb6dd715e39e37702a6d69c220c0f1798bf Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Wed, 31 Jul 2024 17:16:21 -0400 Subject: remove argc, argv; arguments will be passed via environment variables --- euler/source/entry.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'euler/source') 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 #include -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 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 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); -- cgit v1.2.3