diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-04-02 09:22:12 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-04-02 09:22:12 +0200 |
| commit | 61c1f7157c0087b8afc686b59740f99f3eb5dbfe (patch) | |
| tree | e4e40f2b7260e2f542fab9de8fbc379a86142968 /src/wrapped | |
| parent | 5ab4028257b2667418e51c0996e7e3890228f31f (diff) | |
| download | box64-61c1f7157c0087b8afc686b59740f99f3eb5dbfe.tar.gz box64-61c1f7157c0087b8afc686b59740f99f3eb5dbfe.zip | |
Added wrapped libutil
Diffstat (limited to 'src/wrapped')
| -rwxr-xr-x | src/wrapped/wrappedutil.c | 41 | ||||
| -rw-r--r-- | src/wrapped/wrappedutil_private.h | 10 |
2 files changed, 51 insertions, 0 deletions
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) |