From cebaa87a16616041d3185f42219549a9bdb09483 Mon Sep 17 00:00:00 2001 From: bptato <60043228+bptato@users.noreply.github.com> Date: Sat, 10 May 2025 13:26:00 +0200 Subject: [PATCH] Correct nfds_t size on Android (#24647) Turns out bionic uses an unsigned int (unlike other Linux libcs). (See .) (cherry picked from commit 6f5e5811fc876fb713ac34608b5a40b27c96d01f) --- lib/posix/posix.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index eb384fb342..9239ca1482 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -1104,7 +1104,9 @@ when not defined(lwip): # Meanwhile, BSD derivatives had used unsigned int; we will use this # for the else case, because it is more widely cloned than SVR4's # behavior. - when defined(linux) or defined(haiku): + # Finally, bionic libc (Android) also uses unsigned int, despite being + # a Linux. + when defined(linux) and not defined(android) or defined(haiku): type Tnfds* {.importc: "nfds_t", header: "".} = culong elif defined(zephyr):