diff options
author | Benji Dial <benji@benjidial.net> | 2024-07-31 17:16:21 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-07-31 17:16:21 -0400 |
commit | e6915fb6dd715e39e37702a6d69c220c0f1798bf (patch) | |
tree | 2e3b59335f70f2725802d254168ceaee85faf891 /euler/source | |
parent | b1cf9e5dfbc8967bd7cb2a22ec1e5e521f4e0e6e (diff) | |
download | hilbert-os-e6915fb6dd715e39e37702a6d69c220c0f1798bf.tar.gz |
remove argc, argv; arguments will be passed via environment variables
Diffstat (limited to 'euler/source')
-rw-r--r-- | euler/source/entry.cpp | 19 |
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); |