1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 07:47:34 +00:00

UserspaceEmulator: Don't just return "EMULATED" in get_process_name()

Now that emulated processes have their real name (with a "(UE)" prefix)
we can actually let them know their name.
This commit is contained in:
Andreas Kling 2020-07-27 23:41:01 +02:00
parent 308d3b764f
commit 9def88e08d

View file

@ -559,10 +559,12 @@ int Emulator::virt$set_mmap_name(FlatPtr)
int Emulator::virt$get_process_name(FlatPtr buffer, int size) int Emulator::virt$get_process_name(FlatPtr buffer, int size)
{ {
if (size < 9) if (size < 0)
return -ENAMETOOLONG; return -EINVAL;
mmu().copy_to_vm(buffer, "EMULATED", 9); auto host_buffer = ByteBuffer::create_zeroed((size_t)size);
return 0; int rc = syscall(SC_get_process_name, host_buffer.data(), host_buffer.size());
mmu().copy_to_vm(buffer, host_buffer.data(), host_buffer.size());
return rc;
} }
int Emulator::virt$lseek(int fd, off_t offset, int whence) int Emulator::virt$lseek(int fd, off_t offset, int whence)