diff options
author | Rayyan Ansari <rayyan@ansari.sh> | 2023-02-16 14:52:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-16 14:52:24 (GMT) |
commit | 739c026f4488bd2e37d500a2c3d948aaf929b641 (patch) | |
tree | 733937b9fe265101f480e7a2480d427c1909cbac /Include | |
parent | 36b139af638cdeb671cb6b8b0315b254148688f7 (diff) | |
download | cpython-739c026f4488bd2e37d500a2c3d948aaf929b641.zip cpython-739c026f4488bd2e37d500a2c3d948aaf929b641.tar.gz cpython-739c026f4488bd2e37d500a2c3d948aaf929b641.tar.bz2 |
gh-101881: Support (non-)blocking read/write functions on Windows pipes (GH-101882)
* fileutils: handle non-blocking pipe IO on Windows
Handle erroring operations on non-blocking pipes by reading the _doserrno code.
Limit writes on non-blocking pipes that are too large.
* Support blocking functions on Windows
Use the GetNamedPipeHandleState and SetNamedPipeHandleState Win32 API functions to add support for os.get_blocking and os.set_blocking.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_fileutils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h index ac89c43..f8e2bf2 100644 --- a/Include/internal/pycore_fileutils.h +++ b/Include/internal/pycore_fileutils.h @@ -160,11 +160,11 @@ PyAPI_FUNC(int) _Py_set_inheritable_async_safe(int fd, int inheritable, PyAPI_FUNC(int) _Py_dup(int fd); -#ifndef MS_WINDOWS PyAPI_FUNC(int) _Py_get_blocking(int fd); PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking); -#else /* MS_WINDOWS */ + +#ifdef MS_WINDOWS PyAPI_FUNC(void*) _Py_get_osfhandle_noraise(int fd); PyAPI_FUNC(void*) _Py_get_osfhandle(int fd); |