mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Loader: Take main program name from auxiliary vector
This commit is contained in:
parent
0b0c09e647
commit
f12e13e81c
Notes:
sideshowbarker
2024-07-19 00:51:04 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/f12e13e81cd Pull-request: https://github.com/SerenityOS/serenity/pull/3738 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue