Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on Windows.
fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 5cd1efd..659adac 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -71,8 +71,8 @@
if (fp != NULL) {
int i;
- struct stat statb;
- if (fstat(fileno(fp), &statb) == -1) {
+ struct _Py_stat_struct statb;
+ if (_Py_fstat(fileno(fp), &statb) == -1) {
PyErr_SetFromErrno(PyExc_IOError);
return NULL;
}