diff options
author | Brendan Coles <bcoles@gmail.com> | 2021-03-14 15:23:49 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-14 21:36:36 +0100 |
commit | 1eccd78e3a8cf78871184c27c5db60348b2fef8d (patch) | |
tree | 1ea5865f1299da242658b4e3eedee257b84f68ed /Userland/DevTools | |
parent | 202f8550555502b16e07f48d5b4ed6740a8c6fe8 (diff) | |
download | serenity-1eccd78e3a8cf78871184c27c5db60348b2fef8d.zip |
UserspaceEmulator: Add SC_rmdir syscall
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator.h | 1 | ||||
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp | 8 |
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); |