mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 01:04:38 +03:00
UserspaceEmulator: Implement virt$pipe()
This commit is contained in:
parent
633301323b
commit
e12b591509
Notes:
sideshowbarker
2024-07-19 04:48:48 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/e12b591509c Pull-request: https://github.com/SerenityOS/serenity/pull/2809 Issue: https://github.com/SerenityOS/serenity/issues/1440
@ -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 });
|
||||
|
@ -70,6 +70,7 @@ private:
|
||||
u32 virt$mprotect(FlatPtr, size_t, int);
|
||||
u32 virt$madvise(FlatPtr, size_t, int);
|
||||
u32 virt$open(u32);
|
||||
int virt$pipe(FlatPtr pipefd, int flags);
|
||||
int virt$close(int);
|
||||
int virt$get_process_name(FlatPtr buffer, int size);
|
||||
int virt$dbgputstr(FlatPtr characters, int length);
|
||||
|
Loading…
Reference in New Issue
Block a user