diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-08-24 11:09:25 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-08-24 11:32:04 +0200 |
| commit | b8526c79201bdc6d08909d01bb0e41f7cb48ecfc (patch) | |
| tree | 4c9024d6a2fa13374bbb9ccd5494f9aa8e05f706 /src | |
| parent | 2a525b4eb298a5f410014b7fc4a4f7e82130ce4f (diff) | |
| download | box64-b8526c79201bdc6d08909d01bb0e41f7cb48ecfc.tar.gz box64-b8526c79201bdc6d08909d01bb0e41f7cb48ecfc.zip | |
[BOX32][WRAPPER] Added ftw wrapped function to libc
Diffstat (limited to 'src')
| -rwxr-xr-x | src/wrapped32/wrappedlibc.c | 21 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc_private.h | 2 |
2 files changed, 8 insertions, 15 deletions
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c index 618c8a3f..a43ca311 100755 --- a/src/wrapped32/wrappedlibc.c +++ b/src/wrapped32/wrappedlibc.c @@ -291,13 +291,14 @@ static void* findcompareFct(void* fct) return NULL; } -#if 0 // ftw #define GO(A) \ -static uintptr_t my32_ftw_fct_##A = 0; \ -static int my32_ftw_##A(void* fpath, void* sb, int flag) \ +static uintptr_t my32_ftw_fct_##A = 0; \ +static int my32_ftw_##A(void* fpath, void* sb, int flag) \ { \ - return (int)RunFunction(my_context, my32_ftw_fct_##A, 3, fpath, sb, flag); \ + static struct i386_stat i386st; \ + FillStatFromStat64(3, sb, &i386st); \ + return (int)RunFunctionFmt(my32_ftw_fct_##A, "ppi", fpath, &i386st, flag); \ } SUPER() #undef GO @@ -315,7 +316,6 @@ static void* findftwFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for libc ftw callback\n"); return NULL; } -#endif // ftw64 #define GO(A) \ static uintptr_t my32_ftw64_fct_##A = 0; \ @@ -1587,19 +1587,12 @@ EXPORT int my32_mkstemps64(x64emu_t* emu, char* template, int suffixlen) free(fname); return ret; } +#endif EXPORT int32_t my32_ftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd) { - static iFppi_t f = NULL; - if(!f) { - library_t* lib = my_lib; - if(!lib) return 0; - f = (iFppi_t)dlsym(lib->priv.w.lib, "ftw"); - } - - return f(pathname, findftwFct(B), nopenfd); + return ftw64(pathname, findftwFct(B), nopenfd); } -#endif EXPORT int32_t my32_nftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd, int32_t flags) { return nftw64(pathname, findnftwFct(B), nopenfd, flags); diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index 3b0bb3f8..15195f04 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -442,7 +442,7 @@ GOW(ftruncate64, iEiI) //GOM(fts_open, pEEpip) //%% //GOM(fts_read, pEEp) //%% // fts_set -//GOM(ftw, iEEppi) //%% +GOM(ftw, iEEppi) //%% GOM(ftw64, iEEppi) //%% GOW(funlockfile, vFS) GOM(futimens, iEEip) |