From 0d35a59ce3242b7326890a8c8cc41b321192ec9a Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 26 Jul 2022 11:16:51 +0200 Subject: gh-95174: Handle missing dup() and constants in WASI (GH-95229) - check for ``dup()`` libc function - handle missing ``F_DUPFD`` in ``dup2()`` replacement function - add workaround for WASI libc bug in MSG_TRUNC - ESHUTDOWN is missing, use EPIPE instead - POLLPRI is missing, define as 0 (no-op) --- Modules/selectmodule.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Modules/selectmodule.c') diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 5c36eaaede..4eea928a26 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -63,6 +63,11 @@ extern void bzero(void *, int); # define SOCKET int #endif +// WASI SDK 16 does not have POLLPRIO, define as no-op +#if defined(__wasi__) && !defined(POLLPRI) +# define POLLPRI 0 +#endif + typedef struct { PyObject *close; PyTypeObject *poll_Type; -- cgit v1.2.1