From bc30c81d24270eafe0728a3fe14ca4ccdea14bdc Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 24 Jan 2025 21:52:46 +0100 Subject: [PATCH] Correct nfds_t size on Android Turns out bionic uses an unsigned int (unlike other Linux libcs). --- 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 15ce82eb32176..fcaac50a7967c 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -1099,7 +1099,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):