summaryrefslogtreecommitdiff
path: root/euler/source/entry.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-07-31 17:16:21 -0400
committerBenji Dial <benji@benjidial.net>2024-07-31 17:16:21 -0400
commite6915fb6dd715e39e37702a6d69c220c0f1798bf (patch)
tree2e3b59335f70f2725802d254168ceaee85faf891 /euler/source/entry.cpp
parentb1cf9e5dfbc8967bd7cb2a22ec1e5e521f4e0e6e (diff)
downloadhilbert-os-e6915fb6dd715e39e37702a6d69c220c0f1798bf.tar.gz
remove argc, argv; arguments will be passed via environment variables
Diffstat (limited to 'euler/source/entry.cpp')
-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);