UserspaceEmulator: Put the executable name in argv[0] :^)

The emulated program can now find its own name in argv[0]. Very cool!
This commit is contained in:
Andreas Kling 2020-07-12 20:24:10 +02:00
parent ddf7b817df
commit 079021a607
Notes: sideshowbarker 2024-07-19 04:53:22 +09:00
5 changed files with 23 additions and 6 deletions

View file

@ -47,7 +47,7 @@ int main(int argc, char** argv)
auto elf = ELF::Loader::create((const u8*)mapped_file.data(), mapped_file.size());
UserspaceEmulator::Emulator emulator(move(elf));
UserspaceEmulator::Emulator emulator(executable_path, move(elf));
if (!emulator.load_elf())
return 1;