about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-10-26 16:59:20 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-10-26 16:59:20 +0200
commit83dbd728eff99911821021d38c99ac48babb82ba (patch)
tree47dd92286cf250a10ce24721718ad185533fd95d /src
parent31a6149b0f1e821f7b81dcb78e0bc8442291115f (diff)
downloadbox64-83dbd728eff99911821021d38c99ac48babb82ba.tar.gz
box64-83dbd728eff99911821021d38c99ac48babb82ba.zip
Added syscalls 7 and 112
Diffstat (limited to 'src')
-rwxr-xr-xsrc/emu/x64syscall.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c
index 45f4a079..e11e5e1e 100755
--- a/src/emu/x64syscall.c
+++ b/src/emu/x64syscall.c
@@ -81,6 +81,9 @@ scwrap_t syscallwrap[] = {
     //{ 4, __NR_stat, 2 },     // Need to align struct stat
     //{ 5, __NR_fstat, 2},
     //{ 6, __NR_lstat, 2},
+    #ifdef __NR_poll
+    { 7, __NR_poll, 3},
+    #endif
     { 8, __NR_lseek, 3},
     //{ 9, __NR_mmap, 6},       // wrapped to track mmap
     //{ 10, __NR_mprotect, 3},  // same
@@ -140,6 +143,7 @@ scwrap_t syscallwrap[] = {
     { 96, __NR_gettimeofday, 2},
     { 97, __NR_getrlimit, 2},
     { 101, __NR_ptrace, 4},
+    { 112, __NR_setsid, 0},
     { 118, __NR_getresuid, 3},
     { 120, __NR_getresgid, 3},
     { 125, __NR_capget, 2},
@@ -380,6 +384,11 @@ void EXPORT x64Syscall(x64emu_t *emu)
         case 6: // sys_lstat
             *(int64_t*)&R_RAX = my_lstat(emu, (void*)R_RDI, (void*)R_RSI);
             break;
+        #ifndef __NR_poll
+        case 7: // sys_poll
+            *(int64_t*)&R_RAX = poll((struct pollfd*)R_RDI, (nfds_t)R_RSI, (int)R_EDX);
+            break;
+        #endif
         case 9: // sys_mmap
             R_RAX = (uintptr_t)my_mmap64(emu, (void*)R_RDI, R_RSI, (int)R_EDX, (int)R_R10d, (int)R_R8d, R_R9);
             break;
@@ -619,6 +628,11 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu)
             return (uint64_t)(int64_t)my_fstat(emu, (int)R_ESI, (void*)R_RDX);
         case 6: // sys_lstat
             return (uint64_t)(int64_t)my_lstat(emu, (void*)R_RSI, (void*)R_RDX);
+        #ifndef __NR_poll
+        case 7: // sys_poll
+            return (uint64_t)(int64_t)poll((struct pollfd*)R_RSI, (nfds_t)R_RDX, (int)R_ECX);
+            break;
+        #endif
         case 9: // sys_mmap
             return (uintptr_t)my_mmap64(emu, (void*)R_RSI, R_RDX, (int)R_RCX, (int)R_R8d, (int)R_R9, i64(0));
         case 10: // sys_mprotect