From 9ac536a1dd0a0b9bffebea3244d9533628c19b65 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 29 Aug 2024 18:17:49 +0200 Subject: [BOX32] More fixes to ctype_b_loc and added a few more wrapped functions --- src/wrapped32/wrappedlibc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/wrapped32/wrappedlibc.c') diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c index 5b2b2c6d..fed5a414 100755 --- a/src/wrapped32/wrappedlibc.c +++ b/src/wrapped32/wrappedlibc.c @@ -1178,16 +1178,16 @@ EXPORT int my32___fxstat(x64emu_t *emu, int vers, int fd, void* buf) r = FillStatFromStat64(vers, &st, buf); return r; } - +#endif EXPORT int my32___fxstat64(x64emu_t *emu, int vers, int fd, void* buf) { struct stat64 st; int r = fstat64(fd, &st); //int r = syscall(__NR_stat64, fd, &st); - UnalignStat64(&st, buf); + UnalignStat64_32(&st, buf); return r; } - +#if 0 EXPORT int my32_stat64(x64emu_t* emu, void* path, void* buf) { struct stat64 st; @@ -2309,8 +2309,12 @@ EXPORT int my32_alphasort64(x64emu_t* emu, ptr_t* d1_, ptr_t* d2_) EXPORT void* my32___ctype_b_loc(x64emu_t* emu) { const unsigned short** src =__ctype_b_loc(); - memcpy(emu->libctype, &((*src)[-128]), 384*sizeof(short)); - return &emu->libctype[128]; + if(src != emu->ref_ctype) { + memcpy(emu->libctype, &((*src)[-128]), 384*sizeof(short)); + emu->ref_ctype = src; + emu->ctype = emu->libctype+128; + } + return &emu->ctype; } EXPORT struct __processor_model -- cgit 1.4.1