summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.h
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-06-24 06:55:39 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-06-24 06:55:39 (GMT)
commit5135992164f4c0df8d18d3b486431b28214db16b (patch)
tree7bc3060d22ad740bf2bf795caae1c6a46232f6e7 /Modules/_io/_iomodule.h
parent8150492f11f17e2a09f7deb7af706536bc326c98 (diff)
downloadcpython-5135992164f4c0df8d18d3b486431b28214db16b.zip
cpython-5135992164f4c0df8d18d3b486431b28214db16b.tar.gz
cpython-5135992164f4c0df8d18d3b486431b28214db16b.tar.bz2
Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
Diffstat (limited to 'Modules/_io/_iomodule.h')
-rw-r--r--Modules/_io/_iomodule.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index c198b43..aa8bfd6 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -57,6 +57,11 @@ extern Py_ssize_t _PyIO_find_line_ending(
int translated, int universal, PyObject *readnl,
Py_UNICODE *start, Py_UNICODE *end, Py_ssize_t *consumed);
+/* Return 1 if an EnvironmentError with errno == EINTR is set (and then
+ clears the error indicator), 0 otherwise.
+ Should only be called when PyErr_Occurred() is true.
+*/
+extern int _PyIO_trap_eintr(void);
#define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */