about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-10-08 14:15:05 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-10-08 14:15:05 +0200
commitc33e39bd25268edc807f531f3b135ec074457d60 (patch)
treededb0e5d6846890633e9fa9245da50b5ca5221d1 /src
parent1dd9b2302212012fb8b313a748490d17ba925ff1 (diff)
downloadbox64-c33e39bd25268edc807f531f3b135ec074457d60.tar.gz
box64-c33e39bd25268edc807f531f3b135ec074457d60.zip
[BOX32][WRAPPER] Added some more libc 32bits wrapped functions
Diffstat (limited to 'src')
-rw-r--r--src/libtools/libc_net32.c96
-rw-r--r--src/wrapped32/generated/functions_list.txt9
-rw-r--r--src/wrapped32/generated/wrappedlibctypes32.h6
-rw-r--r--src/wrapped32/generated/wrapper32.c6
-rw-r--r--src/wrapped32/generated/wrapper32.h3
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h8
6 files changed, 124 insertions, 4 deletions
diff --git a/src/libtools/libc_net32.c b/src/libtools/libc_net32.c
index 9bb4118f..0d0ae7bf 100644
--- a/src/libtools/libc_net32.c
+++ b/src/libtools/libc_net32.c
@@ -240,6 +240,46 @@ EXPORT int my32_gethostbyname_r(x64emu_t* emu, void* name, struct i386_hostent*
     return r;
 }
 
+EXPORT int my32_gethostbyname2_r(x64emu_t* emu, void* name, int af, struct i386_hostent* ret, void* buff, size_t buflen, ptr_t* result, int* h_err)
+{
+    struct hostent ret_l = {0};
+    struct hostent *result_l = NULL;
+    int r = gethostbyname2_r(name, af, &ret_l, buff, buflen, &result_l, h_err);
+    if(!result_l)
+        *result = 0;
+    else
+        *result = to_ptrv(ret);
+    // convert result, all memory allocated should be in program space
+    if(result_l) {
+        ret->h_name = to_cstring(result_l->h_name);
+        ret->h_addrtype = result_l->h_addrtype;
+        ret->h_length = result_l->h_length;
+        int idx = 0;
+        ret->h_aliases = to_ptrv(result_l->h_aliases);
+        if(result_l->h_aliases) {
+            char** p = result_l->h_aliases;
+            ptr_t* strings = from_ptrv(ret->h_aliases);
+            while(*p) {
+                strings[idx++] = to_cstring(*p);
+                ++p;
+            }
+            strings[idx++] = 0;
+        }
+        idx = 0;
+        ret->h_addr_list = to_ptrv(result_l->h_addr_list);
+        if(result_l->h_addr_list) {
+            char** p = result_l->h_addr_list;
+            ptr_t* strings = from_ptrv(ret->h_addr_list);
+            while(*p) {
+                strings[idx++] = to_ptrv(*p);
+                ++p;
+            }   
+            strings[idx++] = 0;
+        }
+    }
+    return r;
+}
+
 EXPORT void* my32_gethostbyaddr(x64emu_t* emu, const char* a, uint32_t len, int type)
 {
     static struct i386_hostent ret = {0};
@@ -411,6 +451,62 @@ EXPORT void* my32_getprotobyname(x64emu_t* emu, void* name)
     return &my_protoent;
 }
 
+EXPORT int my32_getprotobyname_r(x64emu_t* emu, void* name,struct protoent_32* ret, void* buff, size_t buflen, ptr_t* result)
+{
+    struct protoent ret_l = {0};
+    struct protoent *result_l = NULL;
+    int r = getprotobyname_r(name, &ret_l, buff, buflen, &result_l);
+    if(!result_l)
+        *result = 0;
+    else
+        *result = to_ptrv(ret);
+    // convert result, all memory allocated should be in program space
+    if(result_l) {
+        ret->p_name = to_cstring(result_l->p_name);
+        int idx = 0;
+        if(result_l->p_aliases) {
+            char** p = result_l->p_aliases;
+            ptr_t* strings = from_ptrv(ret->p_aliases);
+            while(*p) {
+                strings[idx++] = to_cstring(*p);
+                ++p;
+            }
+            strings[idx++] = 0;
+        }
+        ret->p_aliases = to_ptrv(result_l->p_aliases);
+        ret->p_proto = result_l->p_proto;
+    }
+    return r;
+}
+
+EXPORT int my32_getprotobynumber_r(x64emu_t* emu, int proto,struct protoent_32* ret, void* buff, size_t buflen, ptr_t* result)
+{
+    struct protoent ret_l = {0};
+    struct protoent *result_l = NULL;
+    int r = getprotobynumber_r(proto, &ret_l, buff, buflen, &result_l);
+    if(!result_l)
+        *result = 0;
+    else
+        *result = to_ptrv(ret);
+    // convert result, all memory allocated should be in program space
+    if(result_l) {
+        ret->p_name = to_cstring(result_l->p_name);
+        int idx = 0;
+        if(result_l->p_aliases) {
+            char** p = result_l->p_aliases;
+            ptr_t* strings = from_ptrv(ret->p_aliases);
+            while(*p) {
+                strings[idx++] = to_cstring(*p);
+                ++p;
+            }
+            strings[idx++] = 0;
+        }
+        ret->p_aliases = to_ptrv(result_l->p_aliases);
+        ret->p_proto = result_l->p_proto;
+    }
+    return r;
+}
+
 typedef struct my_res_state_32_s {
 	int	retrans;
 	int	retry;
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index 47c2df6f..13fdb3a9 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -1675,6 +1675,7 @@
 #() iEEiippi -> iEEiippi
 #() iEEiLLLL -> iEEiLLLL
 #() iEEipiup -> iEEipiup
+#() iEEippup -> iEEippup
 #() iEEuppLp -> iEEuppLp
 #() iEEpiipi -> iEEpiipi
 #() iFEpiipi -> iFEpiipi
@@ -1688,6 +1689,7 @@
 #() iFEppipp -> iFEppipp
 #() iEEppupi -> iEEppupi
 #() iFEppllp -> iFEppllp
+#() iEEpppup -> iEEpppup
 #() iEEpppLp -> iEEpppLp
 #() iFEXLilp -> iFEXLilp
 #() iFEXLpiL -> iFEXLpiL
@@ -1951,6 +1953,7 @@
 #() vFXLiiiLii -> vFXLiiiLii
 #() vFXLLLiipi -> vFXLLLiipi
 #() vFXppuulll -> vFXppuulll
+#() iFEpippupp -> iFEpippupp
 #() iEEpippppp -> iEEpippppp
 #() iEEpLiLppp -> iEEpLiLppp
 #() iFEppipppp -> iFEppipppp
@@ -2564,6 +2567,8 @@ wrappedlibc:
   - prctl
 - iEipiup:
   - statx
+- iEippup:
+  - getprotobynumber_r
 - iEipppp:
   - __select64
   - getopt_long
@@ -2575,6 +2580,8 @@ wrappedlibc:
 - iEpipOi:
 - iEppupi:
   - regexec
+- iEpppup:
+  - getprotobyname_r
 - iEpppLp:
   - getgrnam_r
   - getpwnam_r
@@ -2594,6 +2601,8 @@ wrappedlibc:
   - process_vm_writev
 - pEpLiiiI:
 - pEpLiiil:
+- iFpippupp:
+  - gethostbyname2_r
 - iEpippppp:
 - iEpLiLppp:
 - iFpuippupp:
diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h
index 635d4441..f7940d3f 100644
--- a/src/wrapped32/generated/wrappedlibctypes32.h
+++ b/src/wrapped32/generated/wrappedlibctypes32.h
@@ -126,12 +126,14 @@ typedef int32_t (*iEiiipp_t)(int32_t, int32_t, int32_t, void*, void*);
 typedef int32_t (*iEiippi_t)(int32_t, int32_t, void*, void*, int32_t);
 typedef int32_t (*iEiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
 typedef int32_t (*iEipiup_t)(int32_t, void*, int32_t, uint32_t, void*);
+typedef int32_t (*iEippup_t)(int32_t, void*, void*, uint32_t, void*);
 typedef int32_t (*iEipppp_t)(int32_t, void*, void*, void*, void*);
 typedef int32_t (*iEuppLp_t)(uint32_t, void*, void*, uintptr_t, void*);
 typedef int32_t (*iEpiipV_t)(void*, int32_t, int32_t, void*, ...);
 typedef int32_t (*iEpiLpp_t)(void*, int32_t, uintptr_t, void*, void*);
 typedef int32_t (*iEpipOi_t)(void*, int32_t, void*, int32_t, int32_t);
 typedef int32_t (*iEppupi_t)(void*, void*, uint32_t, void*, int32_t);
+typedef int32_t (*iEpppup_t)(void*, void*, void*, uint32_t, void*);
 typedef int32_t (*iEpppLp_t)(void*, void*, void*, uintptr_t, void*);
 typedef void* (*pEpLLiN_t)(void*, uintptr_t, uintptr_t, int32_t, ...);
 typedef void* (*pEppLLp_t)(void*, void*, uintptr_t, uintptr_t, void*);
@@ -145,6 +147,7 @@ typedef int32_t (*iEpppppp_t)(void*, void*, void*, void*, void*, void*);
 typedef intptr_t (*lEipLpLL_t)(int32_t, void*, uintptr_t, void*, uintptr_t, uintptr_t);
 typedef void* (*pEpLiiiI_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int64_t);
 typedef void* (*pEpLiiil_t)(void*, uintptr_t, int32_t, int32_t, int32_t, intptr_t);
+typedef int32_t (*iFpippupp_t)(void*, int32_t, void*, void*, uint32_t, void*, void*);
 typedef int32_t (*iEpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*);
 typedef int32_t (*iEpLiLppp_t)(void*, uintptr_t, int32_t, uintptr_t, void*, void*, void*);
 typedef int32_t (*iFpuippupp_t)(void*, uint32_t, int32_t, void*, void*, uint32_t, void*, void*);
@@ -265,17 +268,20 @@ typedef int32_t (*iFpuippupp_t)(void*, uint32_t, int32_t, void*, void*, uint32_t
 	GO(__prctl_time64, iEiLLLL_t) \
 	GO(prctl, iEiLLLL_t) \
 	GO(statx, iEipiup_t) \
+	GO(getprotobynumber_r, iEippup_t) \
 	GO(__select64, iEipppp_t) \
 	GO(getopt_long, iEipppp_t) \
 	GO(getgrgid_r, iEuppLp_t) \
 	GO(getpwuid_r, iEuppLp_t) \
 	GO(regexec, iEppupi_t) \
+	GO(getprotobyname_r, iEpppup_t) \
 	GO(getgrnam_r, iEpppLp_t) \
 	GO(getpwnam_r, iEpppLp_t) \
 	GO(recvmmsg, iEipuurLL__t) \
 	GO(gethostbyname_r, iFpppupp_t) \
 	GO(process_vm_readv, lEipLpLL_t) \
 	GO(process_vm_writev, lEipLpLL_t) \
+	GO(gethostbyname2_r, iFpippupp_t) \
 	GO(gethostbyaddr_r, iFpuippupp_t)
 
 #endif // __wrappedlibcTYPES32_H_
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index 08e4e8a8..fcfe537a 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -1769,6 +1769,7 @@ typedef void (*vFXpiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t);
 typedef int32_t (*iEEiippi_t)(x64emu_t*, int32_t, int32_t, void*, void*, int32_t);
 typedef int32_t (*iEEiLLLL_t)(x64emu_t*, int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
 typedef int32_t (*iEEipiup_t)(x64emu_t*, int32_t, void*, int32_t, uint32_t, void*);
+typedef int32_t (*iEEippup_t)(x64emu_t*, int32_t, void*, void*, uint32_t, void*);
 typedef int32_t (*iEEuppLp_t)(x64emu_t*, uint32_t, void*, void*, uintptr_t, void*);
 typedef int32_t (*iEEpiipi_t)(x64emu_t*, void*, int32_t, int32_t, void*, int32_t);
 typedef int32_t (*iFEpiipi_t)(x64emu_t*, void*, int32_t, int32_t, void*, int32_t);
@@ -1782,6 +1783,7 @@ typedef int32_t (*iFEpLlpp_t)(x64emu_t*, void*, uintptr_t, intptr_t, void*, void
 typedef int32_t (*iFEppipp_t)(x64emu_t*, void*, void*, int32_t, void*, void*);
 typedef int32_t (*iEEppupi_t)(x64emu_t*, void*, void*, uint32_t, void*, int32_t);
 typedef int32_t (*iFEppllp_t)(x64emu_t*, void*, void*, intptr_t, intptr_t, void*);
+typedef int32_t (*iEEpppup_t)(x64emu_t*, void*, void*, void*, uint32_t, void*);
 typedef int32_t (*iEEpppLp_t)(x64emu_t*, void*, void*, void*, uintptr_t, void*);
 typedef int32_t (*iFEXLilp_t)(x64emu_t*, void*, uintptr_t, int32_t, intptr_t, void*);
 typedef int32_t (*iFEXLpiL_t)(x64emu_t*, void*, uintptr_t, void*, int32_t, uintptr_t);
@@ -2045,6 +2047,7 @@ typedef void (*vFXiLpiiuu_t)(void*, int32_t, uintptr_t, void*, int32_t, int32_t,
 typedef void (*vFXLiiiLii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, uintptr_t, int32_t, int32_t);
 typedef void (*vFXLLLiipi_t)(void*, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, void*, int32_t);
 typedef void (*vFXppuulll_t)(void*, void*, void*, uint32_t, uint32_t, intptr_t, intptr_t, intptr_t);
+typedef int32_t (*iFEpippupp_t)(x64emu_t*, void*, int32_t, void*, void*, uint32_t, void*, void*);
 typedef int32_t (*iEEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*);
 typedef int32_t (*iEEpLiLppp_t)(x64emu_t*, void*, uintptr_t, int32_t, uintptr_t, void*, void*, void*);
 typedef int32_t (*iFEppipppp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, void*, void*);
@@ -3932,6 +3935,7 @@ void vFXpiiii_32(x64emu_t *emu, uintptr_t fcn) { vFXpiiii_t fn = (vFXpiiii_t)fcn
 void iEEiippi_32(x64emu_t *emu, uintptr_t fcn) { iEEiippi_t fn = (iEEiippi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; }
 void iEEiLLLL_32(x64emu_t *emu, uintptr_t fcn) { iEEiLLLL_t fn = (iEEiLLLL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20))); emu->libc_err = errno; }
 void iEEipiup_32(x64emu_t *emu, uintptr_t fcn) { iEEipiup_t fn = (iEEipiup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; }
+void iEEippup_32(x64emu_t *emu, uintptr_t fcn) { iEEippup_t fn = (iEEippup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; }
 void iEEuppLp_32(x64emu_t *emu, uintptr_t fcn) { iEEuppLp_t fn = (iEEuppLp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); emu->libc_err = errno; }
 void iEEpiipi_32(x64emu_t *emu, uintptr_t fcn) { iEEpiipi_t fn = (iEEpiipi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; }
 void iFEpiipi_32(x64emu_t *emu, uintptr_t fcn) { iFEpiipi_t fn = (iFEpiipi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); }
@@ -3945,6 +3949,7 @@ void iFEpLlpp_32(x64emu_t *emu, uintptr_t fcn) { iFEpLlpp_t fn = (iFEpLlpp_t)fcn
 void iFEppipp_32(x64emu_t *emu, uintptr_t fcn) { iFEppipp_t fn = (iFEppipp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); }
 void iEEppupi_32(x64emu_t *emu, uintptr_t fcn) { iEEppupi_t fn = (iEEppupi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; }
 void iFEppllp_32(x64emu_t *emu, uintptr_t fcn) { iFEppllp_t fn = (iFEppllp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); }
+void iEEpppup_32(x64emu_t *emu, uintptr_t fcn) { iEEpppup_t fn = (iEEpppup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; }
 void iEEpppLp_32(x64emu_t *emu, uintptr_t fcn) { iEEpppLp_t fn = (iEEpppLp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); emu->libc_err = errno; }
 void iFEXLilp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLilp_t fn = (iFEXLilp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); }
 void iFEXLpiL_32(x64emu_t *emu, uintptr_t fcn) { iFEXLpiL_t fn = (iFEXLpiL_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); }
@@ -4208,6 +4213,7 @@ void vFXiLpiiuu_32(x64emu_t *emu, uintptr_t fcn) { vFXiLpiiuu_t fn = (vFXiLpiiuu
 void vFXLiiiLii_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiiLii_t fn = (vFXLiiiLii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); }
 void vFXLLLiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXLLLiipi_t fn = (vFXLLLiipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); }
 void vFXppuulll_32(x64emu_t *emu, uintptr_t fcn) { vFXppuulll_t fn = (vFXppuulll_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28)), from_long(from_ptri(long_t, R_ESP + 32))); }
+void iFEpippupp_32(x64emu_t *emu, uintptr_t fcn) { iFEpippupp_t fn = (iFEpippupp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); }
 void iEEpippppp_32(x64emu_t *emu, uintptr_t fcn) { iEEpippppp_t fn = (iEEpippppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); emu->libc_err = errno; }
 void iEEpLiLppp_32(x64emu_t *emu, uintptr_t fcn) { iEEpLiLppp_t fn = (iEEpLiLppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); emu->libc_err = errno; }
 void iFEppipppp_32(x64emu_t *emu, uintptr_t fcn) { iFEppipppp_t fn = (iFEppipppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index 4d74b1d0..a092568c 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -1716,6 +1716,7 @@ void vFXpiiii_32(x64emu_t *emu, uintptr_t fnc);
 void iEEiippi_32(x64emu_t *emu, uintptr_t fnc);
 void iEEiLLLL_32(x64emu_t *emu, uintptr_t fnc);
 void iEEipiup_32(x64emu_t *emu, uintptr_t fnc);
+void iEEippup_32(x64emu_t *emu, uintptr_t fnc);
 void iEEuppLp_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpiipi_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpiipi_32(x64emu_t *emu, uintptr_t fnc);
@@ -1729,6 +1730,7 @@ void iFEpLlpp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppipp_32(x64emu_t *emu, uintptr_t fnc);
 void iEEppupi_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppllp_32(x64emu_t *emu, uintptr_t fnc);
+void iEEpppup_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpppLp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEXLilp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEXLpiL_32(x64emu_t *emu, uintptr_t fnc);
@@ -1992,6 +1994,7 @@ void vFXiLpiiuu_32(x64emu_t *emu, uintptr_t fnc);
 void vFXLiiiLii_32(x64emu_t *emu, uintptr_t fnc);
 void vFXLLLiipi_32(x64emu_t *emu, uintptr_t fnc);
 void vFXppuulll_32(x64emu_t *emu, uintptr_t fnc);
+void iFEpippupp_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpippppp_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpLiLppp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppipppp_32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index c498e6e3..650b93b8 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -511,7 +511,7 @@ GOM(gethostbyaddr, pFEpui)
 GOM(gethostbyaddr_r, iFEpuippupp)
 GOM(gethostbyname, pFEp)
 //GO(gethostbyname2, pFpi)
-//GO(gethostbyname2_r, iFpippupp)
+GOM(gethostbyname2_r, iFEpippupp)
 GOM(gethostbyname_r, iFEpppupp)
 //GO(gethostent, pFv)
 //GO(gethostent_r, iFppupp)
@@ -562,9 +562,9 @@ GOW(getppid, iEv)
 GO(getpriority, iEuu)
 GO(getrandom, iEpLu)
 GOM(getprotobyname, pEEp)
-//GO(getprotobyname_r, iEpppup)
+GOM(getprotobyname_r, iEEpppup)
 //GO(getprotobynumber, pEi)
-//GO(getprotobynumber_r, iEippup)
+GOM(getprotobynumber_r, iEEippup)
 //GO(getprotoent, pEv)
 //GO(getprotoent_r, iEppup)
 GOW(getpt, iEv)
@@ -1619,7 +1619,7 @@ GOW(sigsuspend, iEp)
 // __sigsuspend
 GOW(sigtimedwait, iEpprLL_)
 //GOW(sigvec, iEipp)
-//GOW(sigwait, iEpp)
+GOW(sigwait, iEpp)
 //GOW(sigwaitinfo, iEpp)
 GOW(sleep, uEu)
 GOM(snprintf, iEEpLpV) //%%