mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 14:45:08 +00:00
UserspaceEmulator: Emulate the sys$get_stack_bounds() syscall
This commit is contained in:
parent
04d9af79ac
commit
ae81ced21c
2 changed files with 13 additions and 0 deletions
|
@ -252,6 +252,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
|||
return virt$chdir(arg1, arg2);
|
||||
case SC_dup2:
|
||||
return virt$dup2(arg1, arg2);
|
||||
case SC_get_stack_bounds:
|
||||
return virt$get_stack_bounds(arg1, arg2);
|
||||
case SC_access:
|
||||
return virt$access(arg1, arg2, arg3);
|
||||
case SC_waitid:
|
||||
|
@ -549,6 +551,16 @@ int Emulator::virt$setsockopt(FlatPtr params_addr)
|
|||
TODO();
|
||||
}
|
||||
|
||||
int Emulator::virt$get_stack_bounds(FlatPtr base, FlatPtr size)
|
||||
{
|
||||
auto* region = mmu().find_region({ m_cpu.ss(), m_cpu.esp().value() });
|
||||
FlatPtr b = region->base();
|
||||
size_t s = region->size();
|
||||
mmu().copy_to_vm(base, &b, sizeof(b));
|
||||
mmu().copy_to_vm(size, &s, sizeof(s));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Emulator::virt$accept(int sockfd, FlatPtr address, FlatPtr address_length)
|
||||
{
|
||||
socklen_t host_address_length = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue