mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +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
|
@ -2366,7 +2366,7 @@ _Py_dup(int fd)
|
|||
return -1;
|
||||
}
|
||||
|
||||
#else
|
||||
#elif HAVE_DUP
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
fd = dup(fd);
|
||||
|
@ -2383,6 +2383,10 @@ _Py_dup(int fd)
|
|||
_Py_END_SUPPRESS_IPH
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return -1;
|
||||
#endif
|
||||
return fd;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue