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.
This commit is contained in:
Steve Dower 2015-02-21 08:44:05 -08:00
parent 18d1924987
commit f2f373f593
12 changed files with 242 additions and 180 deletions

View file

@ -35,7 +35,7 @@ main(int argc, char *argv[])
{
char *inpath, *outpath;
FILE *infile = NULL, *outfile = NULL;
struct stat st;
struct _Py_stat_struct st;
size_t text_size, data_size, n;
char *text = NULL;
unsigned char *data;
@ -54,7 +54,7 @@ main(int argc, char *argv[])
fprintf(stderr, "cannot open '%s' for reading\n", inpath);
goto error;
}
if (fstat(fileno(infile), &st)) {
if (_Py_fstat(fileno(infile), &st)) {
fprintf(stderr, "cannot fstat '%s'\n", inpath);
goto error;
}