mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:35:06 +00:00
UserspaceEmulator: Implement virt$pipe()
This commit is contained in:
parent
633301323b
commit
e12b591509
2 changed files with 13 additions and 0 deletions
|
@ -221,6 +221,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
|||
return virt$madvise(arg1, arg2, arg3);
|
||||
case SC_open:
|
||||
return virt$open(arg1);
|
||||
case SC_pipe:
|
||||
return virt$pipe(arg1, arg2);
|
||||
case SC_fcntl:
|
||||
return virt$fcntl(arg1, arg2, arg3);
|
||||
case SC_getgroups:
|
||||
|
@ -334,6 +336,16 @@ u32 Emulator::virt$open(u32 params_addr)
|
|||
return fd;
|
||||
}
|
||||
|
||||
int Emulator::virt$pipe(FlatPtr vm_pipefd, int flags)
|
||||
{
|
||||
int pipefd[2];
|
||||
int rc = syscall(SC_pipe, pipefd, flags);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
mmu().copy_to_vm(vm_pipefd, pipefd, sizeof(pipefd));
|
||||
return rc;
|
||||
}
|
||||
|
||||
u32 Emulator::virt$munmap(FlatPtr address, u32 size)
|
||||
{
|
||||
auto* region = mmu().find_region({ 0x20, address });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue