diff -U 1 -Nr pypy2.7-v7.3.6-src/lib_pypy/_resource_build.py pypy2.7-v7.3.6-src.mod/lib_pypy/_resource_build.py
--- pypy2.7-v7.3.6-src/lib_pypy/_resource_build.py	2021-10-03 14:36:11.000000000 +0800
+++ pypy2.7-v7.3.6-src.mod/lib_pypy/_resource_build.py	2022-03-04 20:24:57.662406300 +0800
@@ -75,2 +75,4 @@
 
+/* Termux addition: Add wait3() declaration used by busybox. Available in libc for 32-bit only. */
+static pid_t wait3(int* status, int options, struct rusage* rusage) { return wait4(-1, status, options, rusage); }
 """.replace('$RLIMIT_CONSTS', ''.join(rlimit_consts)))

diff -uNr pypy2.7-v7.3.6-src/lib_pypy/_sysconfigdata.py pypy2.7-v7.3.6-src.mod/lib_pypy/_sysconfigdata.py
--- pypy2.7-v7.3.6-src/lib_pypy/_sysconfigdata.py       2021-10-03 14:36:11.000000000 +0800
+++ pypy2.7-v7.3.6-src.mod/lib_pypy/_sysconfigdata.py   2022-02-08 17:34:58.141093600 +0800
@@ -3,3 +3,7 @@
 build_time_vars = {
     "SO": [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
 }
+
+# Termux Fix: Add ANDROID_API_LEVEL
+build_time_vars["ANDROID_API_LEVEL"] = 24
+



diff -uNr pypy2.7-v7.3.6-src/rpython/rlib/rsocket.py pypy2.7-v7.3.6-src.mod/rpython/rlib/rsocket.py
--- pypy2.7-v7.3.6-src/rpython/rlib/rsocket.py          2021-10-03 14:36:11.000000000 +0800
+++ pypy2.7-v7.3.6-src.mod/rpython/rlib/rsocket.py      2022-01-17 22:54:28.191684700 +0800
@@ -1627,11 +1627,48 @@
         raise RSocketError("port/proto not found")
     return rffi.charp2str(servent.c_s_name)

+PROTOCOL_NAME_AND_NUMBER = {
+    "ip": 0,
+    "icmp": 1,
+    "igmp": 2,
+    "ggp": 3,
+    "ipencap": 4,
+    "st": 5,
+    "tcp": 6,
+    "egp": 8,
+    "pup": 12,
+    "udp": 17,
+    "hmp": 20,
+    "xns-idp": 22,
+    "iso-tp4": 29,
+    "xtp": 36,
+    "ddp": 37,
+    "idpr-cmtp": 38,
+    "ipv6": 41,
+    "ipv6-route": 43,
+    "ipv6-frag": 44,
+    "idrp": 45,
+    "rsvp": 46,
+    "gre": 47,
+    "esp": 50,
+    "ah": 51,
+    "skip": 57,
+    "ipv6-icmp": 58,
+    "ipv6-nonxt": 59,
+    "ipv6-opts": 60,
+    "rspf": 73,
+    "vmtp": 81,
+    "ospf": 89,
+    "ipip": 94,
+    "encap": 98,
+    "pim": 103,
+    "raw": 255
+}
+
 def getprotobyname(name):
-    protoent = _c.getprotobyname(name)
-    if not protoent:
+    proto = PROTOCOL_NAME_AND_NUMBER.get(name, -1)
+    if proto == -1:
         raise RSocketError("protocol not found")
-    proto = protoent.c_p_proto
     return rffi.cast(lltype.Signed, proto)

 def getnameinfo(address, flags):

