about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-11-26 09:35:00 +0000
committerTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-11-26 11:52:54 +0000
commitc1efc9f6a108f9ca3692c8db7cc1ef86e4c11bb7 (patch)
tree3dca3de487c398384e2e7af463d73b55a51e0e17
parent710a7406c91a273a937e1450a0f2bcb0c09aacf1 (diff)
downloadfocaccia-c1efc9f6a108f9ca3692c8db7cc1ef86e4c11bb7.tar.gz
focaccia-c1efc9f6a108f9ca3692c8db7cc1ef86e4c11bb7.zip
Add support for epoll and socket emulation
-rw-r--r--src/focaccia/qemu/x86.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/focaccia/qemu/x86.py b/src/focaccia/qemu/x86.py
index d8641fc..eccd0ef 100644
--- a/src/focaccia/qemu/x86.py
+++ b/src/focaccia/qemu/x86.py
@@ -18,7 +18,22 @@ emulated_system_calls = {
     21: SyscallInfo('access'),
     24: SyscallInfo('sched_yield'),
     34:  SyscallInfo('pause'),
+    35:  SyscallInfo('nanosleep', patchup_address_registers=['rdi', 'rsi']),
     39:  SyscallInfo('getpid'),
+    41:  SyscallInfo('socket'),
+    42:  SyscallInfo('connect', patchup_address_registers=['rsi']),
+    43:  SyscallInfo('accept', patchup_address_registers=['rsi', 'rdx']),
+    44:  SyscallInfo('sendto'),
+    45:  SyscallInfo('recvfrom', patchup_address_registers=['rsi']),
+    46:  SyscallInfo('sendmsg'),
+    47:  SyscallInfo('recvmsg', patchup_address_registers=['rsi']),
+    49:  SyscallInfo('bind', patchup_address_registers=['rsi']),
+    50:  SyscallInfo('listen'),
+    51:  SyscallInfo('getsockname', patchup_address_registers=['rsi', 'rdx']),
+    52:  SyscallInfo('getpeername', patchup_address_registers=['rsi', 'rdx']),
+    53:  SyscallInfo('sockpair', patchup_address_registers=['r10']),
+    54:  SyscallInfo('setsockopt'),
+    55:  SyscallInfo('getsockpair', patchup_address_registers=['r10', 'r8']),
     72:  SyscallInfo('fcntl', patchup_address_registers=['rdx']),
     73:  SyscallInfo('flock'),
     74:  SyscallInfo('fsync'),
@@ -44,6 +59,10 @@ emulated_system_calls = {
     94:  SyscallInfo('lchown'),
     95:  SyscallInfo('umask'),
     102: SyscallInfo('getuid'),
+    213: SyscallInfo('epoll_create'),
+    232: SyscallInfo('epoll_wait', patchup_address_registers=['rsi']),
+    233: SyscallInfo('epoll_ctl', patchup_address_registers=['r10']),
+    281: SyscallInfo('epoll_pwait', patchup_address_registers=['rsi', 'r8']),
     318: SyscallInfo('getrandom', patchup_address_registers=['rdi'])
 }