about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/library_list.h2
-rwxr-xr-xsrc/wrapped/wrappedutil.c41
-rw-r--r--src/wrapped/wrappedutil_private.h10
3 files changed, 52 insertions, 1 deletions
diff --git a/src/library_list.h b/src/library_list.h
index bdbe9348..e8f9f116 100755
--- a/src/library_list.h
+++ b/src/library_list.h
@@ -79,7 +79,7 @@ GO("libdbus-1.so.3", dbus)
 //GO("libcrypto.so.1", crypto)
 //GO("libssl.so.1", libssl)
 //GO("libcrypt.so.1", libcrypt)
-//GO("libutil.so.1", util)
+GO("libutil.so.1", util)
 GO("libuuid.so.1", libuuid)
 GO("libresolv.so.2", libresolv)
 GO("libpulse-simple.so.0", pulsesimple)
diff --git a/src/wrapped/wrappedutil.c b/src/wrapped/wrappedutil.c
new file mode 100755
index 00000000..68f5757a
--- /dev/null
+++ b/src/wrapped/wrappedutil.c
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE         /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "box64stack.h"
+#include "x64emu.h"
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "callback.h"
+#include "librarian.h"
+#include "librarian/library_private.h"
+#include "emu/x64emu_private.h"
+#include "box64context.h"
+
+const char* utilName = "libutil.so.1";
+#define LIBNAME util
+
+EXPORT pid_t my_forkpty(x64emu_t* emu, void* amaster, void* name, void* termp, void* winp)
+{
+    static forkpty_t forkinfo;
+    forkinfo.amaster = amaster;
+    forkinfo.name = name;
+    forkinfo.termp = termp;
+    forkinfo.winp = winp;
+    library_t* lib = GetLibInternal(utilName);
+    forkinfo.f = dlsym(lib->priv.w.lib, "forkpty");
+    
+    emu->quit = 1;
+    emu->fork = 2;
+    emu->forkpty_info = &forkinfo;
+        
+    return 0;
+}
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedutil_private.h b/src/wrapped/wrappedutil_private.h
new file mode 100644
index 00000000..719881f0
--- /dev/null
+++ b/src/wrapped/wrappedutil_private.h
@@ -0,0 +1,10 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh....
+#endif
+
+GOM(forkpty, iFEpppp)
+GO(login, vFp)
+GO(login_tty, iFi)
+GO(logout, iFp)
+GO(logwtmp, vFppp)
+GO(openpty, iFppppp)