summaryrefslogtreecommitdiff
path: root/Userland/DynamicLoader
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2020-11-11 21:13:55 +0200
committerAndreas Kling <kling@serenityos.org>2020-12-14 23:05:53 +0100
commitf12e13e81cdab4cf298648346e761348de811ef5 (patch)
treeb16dab382ec432dd4e64d31d402aacee4563cfd4 /Userland/DynamicLoader
parent0b0c09e647e0f34fce503d15a4d06c7f57b96d4e (diff)
downloadserenity-f12e13e81cdab4cf298648346e761348de811ef5.zip
Loader: Take main program name from auxiliary vector
Diffstat (limited to 'Userland/DynamicLoader')
-rw-r--r--Userland/DynamicLoader/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp
index 8bd5e74798..c8a9904d62 100644
--- a/Userland/DynamicLoader/main.cpp
+++ b/Userland/DynamicLoader/main.cpp
@@ -244,15 +244,17 @@ static void clear_temporary_objects_mappings()
static FlatPtr loader_main(auxv_t* auxvp)
{
int main_program_fd = -1;
+ String main_program_name;
for (; auxvp->a_type != AT_NULL; ++auxvp) {
if (auxvp->a_type == AuxiliaryValue::ExecFileDescriptor) {
main_program_fd = auxvp->a_un.a_val;
}
+ if (auxvp->a_type == AuxiliaryValue::ExecFilename) {
+ main_program_name = (const char*)auxvp->a_un.a_ptr;
+ }
}
ASSERT(main_program_fd >= 0);
- // TODO: Pass this in the auxiliary vector
- const String main_program_name = "MainProgram";
map_library(main_program_name, main_program_fd);
map_dependencies(main_program_name);