mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 13:42:52 +00:00
UserspaceEmulator: Add support for chmod
This commit is contained in:
parent
b1d36243e5
commit
41aa78f6de
Notes:
sideshowbarker
2024-07-19 01:45:27 +09:00
Author: https://github.com/alimpfard
Commit: 41aa78f6de
Pull-request: https://github.com/SerenityOS/serenity/pull/3831
Reviewed-by: https://github.com/awesomekling
2 changed files with 9 additions and 0 deletions
|
@ -349,6 +349,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
|||
return virt$dbgputstr(arg1, arg2);
|
||||
case SC_dbgputch:
|
||||
return virt$dbgputch(arg1);
|
||||
case SC_chmod:
|
||||
return virt$chmod(arg1, arg2, arg3);
|
||||
case SC_fchmod:
|
||||
return virt$fchmod(arg1, arg2);
|
||||
case SC_accept:
|
||||
|
@ -492,6 +494,12 @@ int Emulator::virt$dbgputstr(FlatPtr characters, int length)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Emulator::virt$chmod(FlatPtr path_addr, size_t path_length, mode_t mode)
|
||||
{
|
||||
auto path = mmu().copy_buffer_from_vm(path_addr, path_length);
|
||||
return syscall(SC_chmod, path.data(), path.size(), mode);
|
||||
}
|
||||
|
||||
int Emulator::virt$fchmod(int fd, mode_t mode)
|
||||
{
|
||||
return syscall(SC_fchmod, fd, mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue