[3.11] gh-95174: Handle missing dup() and constants in WASI (GH-95229) (GH-95272)

Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Christian Heimes 2022-07-31 17:39:41 +02:00 committed by GitHub
parent c7ac8b6588
commit db13c0c1b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 47 additions and 5 deletions

View file

@ -7650,6 +7650,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