summaryrefslogtreecommitdiff
path: root/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-10-24 11:27:37 +0330
committerAndreas Kling <kling@serenityos.org>2020-10-25 10:13:03 +0100
commit290e7957b74e0b929be4bd6d07c07b3719f5e58d (patch)
tree258656957833404427b9ef2c33bd151be6ca2724 /DevTools/UserspaceEmulator
parentfcc38422c6b6ed3deabf18fff98c6db9d0d68d54 (diff)
downloadserenity-290e7957b74e0b929be4bd6d07c07b3719f5e58d.zip
UserspaceEmulator: Add support for setsid
Diffstat (limited to 'DevTools/UserspaceEmulator')
-rw-r--r--DevTools/UserspaceEmulator/Emulator.cpp7
-rw-r--r--DevTools/UserspaceEmulator/Emulator.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp
index 10a9b7de72..ab763175f6 100644
--- a/DevTools/UserspaceEmulator/Emulator.cpp
+++ b/DevTools/UserspaceEmulator/Emulator.cpp
@@ -395,6 +395,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
return virt$sched_setparam(arg1, arg2);
case SC_set_thread_name:
return virt$set_thread_name(arg1, arg2, arg3);
+ case SC_setsid:
+ return virt$setsid();
default:
reportln("\n=={}== \033[31;1mUnimplemented syscall: {}\033[0m, {:p}", getpid(), Syscall::to_string((Syscall::Function)function), function);
dump_backtrace();
@@ -1460,4 +1462,9 @@ int Emulator::virt$set_thread_name(pid_t pid, FlatPtr name_addr, size_t name_len
return syscall(SC_set_thread_name, pid, name.characters(), name.length());
}
+pid_t Emulator::virt$setsid()
+{
+ return syscall(SC_setsid);
+}
+
}
diff --git a/DevTools/UserspaceEmulator/Emulator.h b/DevTools/UserspaceEmulator/Emulator.h
index cefa9d6ca4..baaf4edeea 100644
--- a/DevTools/UserspaceEmulator/Emulator.h
+++ b/DevTools/UserspaceEmulator/Emulator.h
@@ -153,6 +153,7 @@ private:
int virt$sched_setparam(int, FlatPtr);
int virt$sched_getparam(pid_t, FlatPtr);
int virt$set_thread_name(pid_t, FlatPtr, size_t);
+ pid_t virt$setsid();
FlatPtr allocate_vm(size_t size, size_t alignment);