12// file should start with a blank line.34// This extern "C" is needed so pyconfig.h can also be included in C++ code, e.g., numpy.5#ifdef __cplusplus6extern "C" {7#endif8#include "posix-wasm.h"9#ifdef __cplusplus10}11#endif121314#undef HAVE_LINUX_VM_SOCKETS_H15#define POLLPRI 016#undef GETPGRP_HAVE_ARG1718// I did implement the non-BSD version of this though, which19// doesn't get detected by autoconf:20#define SETPGRP_HAVE_ARG 12122#define PY_CALL_TRAMPOLINE2324// We only use the emscripten changes for the actual changes to the files, NOT for25// the extra flags, etc., that are imposed on the build tools, which break things badly.26// Thus instead of an option to ./configure, we #define these here.27#ifndef __EMSCRIPTEN28#define __EMSCRIPTEN__ 129#endif30#define __EMSCRIPTEN_major__ 331#define __EMSCRIPTEN_minor__ 132#define __EMSCRIPTEN_tiny__ 163334// sysconfig(_SC_OPEN_MAX) = -1 in upstream musl wasi.35// By undef'ing this constant, we cause Python to think36// that sysconfig doesn't know anything about SC_OPEN_MAX,37// so Python falls back to some default. This is the right38// thing to do since (1) we can't change upstream wasi, and39// (2) wasi setting it to -1 is meant to convey that they40// don't know. In fact, in our wasi-js implementation,41// we are setting the limit to 32768 since it takes about42// 0.2 seconds with wasi-js to stat everything up that bound,43// which seems acceptable for this sort of thing.44// The modern OS default is 2**20 = 1048575, and it takes45// about 0.5 seconds to stat everything up to that (of course,46// modern os's have better system calls so that stating everything47// isn't needed). TODO: I'm also probably going to patch Python48// itself to replace its 256 default fallback with 32768 everywhere,49// though that can wait.50#undef _SC_OPEN_MAX5152// we provide our own stubs53#undef HAVE_PTHREAD_STUBS5455