mirror of
https://github.com/python/cpython.git
synced 2025-10-15 03:10:29 +00:00
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)
This commit is contained in:
parent
e8f3e8f0ab
commit
0d35a59ce3
12 changed files with 47 additions and 5 deletions
|
@ -7786,6 +7786,10 @@ PyInit__socket(void)
|
|||
PyModule_AddIntMacro(m, MSG_EOR);
|
||||
#endif
|
||||
#ifdef MSG_TRUNC
|
||||
// workaround for https://github.com/WebAssembly/wasi-libc/issues/305
|
||||
#if defined(__wasi__) && !defined(__WASI_RIFLAGS_RECV_DATA_TRUNCATED)
|
||||
# define __WASI_RIFLAGS_RECV_DATA_TRUNCATED 2
|
||||
#endif
|
||||
PyModule_AddIntMacro(m, MSG_TRUNC);
|
||||
#endif
|
||||
#ifdef MSG_CTRUNC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue