summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index 586593cbb0..dda6fced3d 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -168,6 +168,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
return virt$getsockopt(arg1);
case SC_get_process_name:
return virt$get_process_name(arg1, arg2);
+ case SC_set_process_name:
+ return virt$set_process_name(arg1, arg2);
case SC_dbgputstr:
return virt$dbgputstr(arg1, arg2);
case SC_dbgputch:
@@ -481,6 +483,15 @@ int Emulator::virt$get_process_name(FlatPtr buffer, int size)
return rc;
}
+int Emulator::virt$set_process_name(FlatPtr user_buffer, int size)
+{
+ if (size < 0)
+ return -EINVAL;
+ auto host_buffer = mmu().copy_buffer_from_vm(user_buffer, size);
+ auto name = String::formatted("(UE) {}", StringView { host_buffer.data(), host_buffer.size() });
+ return syscall(SC_set_process_name, name.characters(), name.length());
+}
+
int Emulator::virt$lseek(int fd, off_t offset, int whence)
{
return syscall(SC_lseek, fd, offset, whence);