about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-04-05 18:20:47 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-04-05 18:20:47 +0200
commit676b7523b36eabaa48073c9da84512ffc0261581 (patch)
tree43551f1ab3c881f13578ca9a08c4d15f48fc1e6b /src
parent880616397f6fb5bd571b3b8f913882f3a2156525 (diff)
downloadbox64-676b7523b36eabaa48073c9da84512ffc0261581.tar.gz
box64-676b7523b36eabaa48073c9da84512ffc0261581.zip
Added a couple of libc wrapped functions
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c20
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h4
2 files changed, 8 insertions, 16 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 9c437226..6c6398d5 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -738,7 +738,6 @@ EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t*
 }
 
 EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) {
-    // need to align on arm
     CONVERT_VALIST(b);
     int r = vsnprintf(buff, s, fmt, VARARGS);
     return r;
@@ -761,22 +760,14 @@ EXPORT int my_vasprintf(x64emu_t* emu, void* strp, void* fmt, void* b, va_list V
     return r;
     #endif
 }
-EXPORT int my___vasprintf_chk(x64emu_t* emu, void* strp, int flags, void* fmt, void* b, va_list V)
+#endif
+EXPORT int my___vasprintf_chk(x64emu_t* emu, void* buff, int flags, void* fmt, x64_va_list_t b)
 {
-    #ifndef NOALIGN
-    // need to align on arm
-    myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
-    PREPARE_VALIST;
-    void* f = vasprintf;
-    int r = ((iFppp_t)f)(strp, fmt, VARARGS);
-    return r;
-    #else
-    void* f = vasprintf;
-    int r = ((iFppp_t)f)(strp, fmt, (uint32_t*)b);
+    CONVERT_VALIST(b);
+    int r = vasprintf(buff, fmt, VARARGS);
     return r;
-    #endif
 }
-
+#if 0
 EXPORT int my___asprintf_chk(x64emu_t* emu, void* result_ptr, int flags, void* fmt, void* b, va_list V)
 {
     #ifndef NOALIGN
@@ -1472,6 +1463,7 @@ EXPORT int my_ftw64(x64emu_t* emu, void* filename, void* func, int descriptors)
 {
     return ftw64(filename, findftw64Fct(func), descriptors);
 }
+EXPORT int my_ftw(x64emu_t* emu, void* filename, void* func, int descriptors) __attribute__((alias("my_ftw64")));
 
 EXPORT int32_t my_nftw64(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd, int32_t flags)
 {
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index 9adb452a..e3f16ec3 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -443,7 +443,7 @@ GO(fts_close, iFp)
 GO(fts_open, pFEpip)
 GO(fts_read, pFp)
 GO(fts_set, iFppi)
-//GO(ftw, 
+GOM(ftw, iFEppi)
 GOM(ftw64, iFEppi)
 //GOW(funlockfile, 
 //GO(futimens, 
@@ -2035,7 +2035,7 @@ GO(usleep, iFu)
 //GO(utmpxname, 
 GOW(valloc, pFL)
 GOM(vasprintf, iFEppp)   //weak
-//GO(__vasprintf_chk, 
+GOM(__vasprintf_chk, iFEpipp)
 //GOW(vdprintf, 
 //GO(__vdprintf_chk, 
 //GO(verr,