diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-10-12 14:52:49 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-10-12 14:52:49 +0200 |
| commit | 7b66c024f058eddd7055856f1c963d5c84f38cb6 (patch) | |
| tree | 84290d970796649f419095cd7052ce1d1619e5ea /src/wrapped/wrappedlibc.c | |
| parent | af437fa354f387fb563ded1a8db7c5051148b5cd (diff) | |
| download | box64-7b66c024f058eddd7055856f1c963d5c84f38cb6.tar.gz box64-7b66c024f058eddd7055856f1c963d5c84f38cb6.zip | |
[DYNACACHE] Allow Dynacache to be serialized when _exit is used
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 280f5f7b..c3d9da2a 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -3877,7 +3877,19 @@ EXPORT void my_exit(x64emu_t* emu, int code) exit(code); } -EXPORT void my__exit(x64emu_t* emu, int code) __attribute__((alias("my_exit"))); +EXPORT void my__exit(x64emu_t* emu, int code) +{ + if(emu->flags.quitonexit || emu->quit) { + _exit(code); + } + printf_log(LOG_INFO, "Fast _exit called\n"); + emu->quit = 1; + box64_exit_code = code; + SerializeAllMapping(); // just to be safe + // then call all the fini + + _exit(code); +} EXPORT int my_prctl(x64emu_t* emu, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { |