mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
bpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829)
Emscripten's socket emulation is limited. AF_UNIX, AF_PACKET, setsockopt(), and most SO_* constants are not supported.
This commit is contained in:
parent
3b128c0548
commit
ecfff63e06
4 changed files with 22 additions and 5 deletions
|
@ -192,6 +192,21 @@ typedef int socklen_t;
|
|||
|
||||
#endif /* HAVE_SOCKADDR_ALG */
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
// wasm32-emscripten sockets only support subset of IPv4 and IPv6.
|
||||
// SCTP protocol crashes runtime.
|
||||
#ifdef IPPROTO_SCTP
|
||||
# undef IPPROTO_SCTP
|
||||
#endif
|
||||
// setsockopt() fails with ENOPROTOOPT, getsockopt only supports SO_ERROR.
|
||||
// undef SO_REUSEADDR and SO_REUSEPORT so they cannot be used.
|
||||
#ifdef SO_REUSEADDR
|
||||
# undef SO_REUSEADDR
|
||||
#endif
|
||||
#ifdef SO_REUSEPORT
|
||||
# undef SO_REUSEPORT
|
||||
#endif
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
#ifndef Py__SOCKET_H
|
||||
#define Py__SOCKET_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue