about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibc.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-11-27 18:50:47 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-11-27 18:50:47 +0100
commit06851f8b984574cd1532191feca9765ea07904c0 (patch)
treef389096a5bab95f8d4b7cd2be3595d7fac0cd45f /src/wrapped/wrappedlibc.c
parent893fc7c9402dac4bd8c1dd2cbdd42752c59012bd (diff)
downloadbox64-06851f8b984574cd1532191feca9765ea07904c0.tar.gz
box64-06851f8b984574cd1532191feca9765ea07904c0.zip
Added box64rc configuration file handling
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index d1d686b1..6d7169bb 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -38,6 +38,7 @@
 #include <syslog.h>
 #include <malloc.h>
 #include <getopt.h>
+#include <sys/prctl.h>
 #undef LOG_INFO
 #undef LOG_DEBUG
 
@@ -60,6 +61,7 @@
 #include "elfloader.h"
 #include "bridge.h"
 #include "globalsymbols.h"
+#include "rcfile.h"
 
 #define LIBNAME libc
 const char* libcName = "libc.so.6";
@@ -2969,6 +2971,15 @@ EXPORT void my_exit(x64emu_t* emu, int code)
 
 EXPORT void my__exit(x64emu_t* emu, int code) __attribute__((alias("my_exit")));
 
+EXPORT int my_prctl(x64emu_t* emu, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5)
+{
+    if(option==PR_SET_NAME) {
+        printf_log(LOG_DEBUG, "BOX64: set process name to \"%s\"\n", (char*)arg2);
+        ApplyParams((char*)arg2);
+    }
+    return prctl(option, arg2, arg3, arg4, arg5);
+}
+
 
 EXPORT char* my___progname = NULL;
 EXPORT char* my___progname_full = NULL;