summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator.h1
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.h b/Userland/DevTools/UserspaceEmulator/Emulator.h
index 318cecd102..316e5aae19 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator.h
+++ b/Userland/DevTools/UserspaceEmulator/Emulator.h
@@ -123,6 +123,7 @@ private:
int virt$pipe(FlatPtr pipefd, int flags);
int virt$close(int);
int virt$mkdir(FlatPtr path, size_t path_length, mode_t mode);
+ int virt$rmdir(FlatPtr path, size_t path_length);
int virt$unlink(FlatPtr path, size_t path_length);
int virt$get_process_name(FlatPtr buffer, int size);
int virt$set_process_name(FlatPtr buffer, int size);
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index 553ba31a75..f95d4ea810 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -134,6 +134,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
return virt$fstat(arg1, arg2);
case SC_mkdir:
return virt$mkdir(arg1, arg2, arg3);
+ case SC_rmdir:
+ return virt$rmdir(arg1, arg2);
case SC_unlink:
return virt$unlink(arg1, arg2);
case SC_write:
@@ -306,6 +308,12 @@ int Emulator::virt$mkdir(FlatPtr path, size_t path_length, mode_t mode)
return syscall(SC_mkdir, buffer.data(), buffer.size(), mode);
}
+int Emulator::virt$rmdir(FlatPtr path, size_t path_length)
+{
+ auto buffer = mmu().copy_buffer_from_vm(path, path_length);
+ return syscall(SC_rmdir, buffer.data(), buffer.size());
+}
+
int Emulator::virt$unlink(FlatPtr path, size_t path_length)
{
auto buffer = mmu().copy_buffer_from_vm(path, path_length);