mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
UserspaceEmulator: "Add" a couple of syscalls
This patch adds gettid() and stubs out pledge() and unveil() for now.
This commit is contained in:
parent
f87cf701a4
commit
584923445c
2 changed files with 24 additions and 0 deletions
|
@ -185,6 +185,12 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
|||
|
||||
printf("Syscall: %s (%x)\n", Syscall::to_string((Syscall::Function)function), function);
|
||||
switch (function) {
|
||||
case SC_gettid:
|
||||
return virt$gettid();
|
||||
case SC_pledge:
|
||||
return virt$pledge(arg1);
|
||||
case SC_unveil:
|
||||
return virt$unveil(arg1);
|
||||
case SC_getuid:
|
||||
return virt$getuid();
|
||||
case SC_exit:
|
||||
|
@ -196,6 +202,21 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
|||
}
|
||||
}
|
||||
|
||||
u32 Emulator::virt$gettid()
|
||||
{
|
||||
return gettid();
|
||||
}
|
||||
|
||||
u32 Emulator::virt$pledge(u32)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 Emulator::virt$unveil(u32)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uid_t Emulator::virt$getuid()
|
||||
{
|
||||
return getuid();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue