bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mingw and AC_SYS_LARGEFILE


From: Bruno Haible
Subject: Re: mingw and AC_SYS_LARGEFILE
Date: Thu, 12 Apr 2012 13:26:47 +0200
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Hi,

Ray Satiro wrote:
> The gnulib fstat doc says:
> "On platforms where off_t is a 32-bit type, stat may not correctly report the 
> size of files or block devices larger than 2 GB. The fix is to use the 
> AC_SYS_LARGEFILE macro. "
> 
> Recently it was discovered that the latest versions of wget mingw were not 
> handling large files properly. I'm overriding the gnulib fstat in my own 
> builds by doing redefines like this for the stat functions and structs
> #if defined fstat
> #undef fstat
> #endif
> #define fstat _fstati64
> 
> There's no _FILE_OFFSET_BITS stuff in my mingw headers. Do you have any 
> advice for this situation? I'm not subscribed to the list so please cc me.

Supporting 64-bit off_t requires, AFAICS, changes or overrides in the
following types and functions that exist in mingw:
  off_t
  <fcntl.h>: creat, open
  <sys/stat.h>: fstat, lstat, stat
  <unistd.h>: ftruncate, lseek
  <stdio.h>: fgetpos, fopen, freopen, fseek, fsetpos, ftell, tmpfile
  <dirent.h>: opendir, readdir, rewinddir, seekdir, telldir

Indeed native Windows has some primitives for 64-bit files, such as
fstat alternatives [1], lseek alternatives [2], fseek alternatives [3],
ftell alternatives [4].

My advice would be first to ask the currently active mingw development
group, namely the mingw64 project [5], whether they plan to add
"Large File Support" to their header files.

If no, then it could also be done in Gnulib. But obviously, more programs
can benefit from LFS support if it is done in mingw64.

Bruno

[1] http://msdn.microsoft.com/en-us/library/221w8e43.aspx
[2] http://msdn.microsoft.com/en-us/library/1yee101t.aspx
[3] http://msdn.microsoft.com/en-us/library/75yw9bf3.aspx
[4] http://msdn.microsoft.com/en-us/library/0ys3hc0b.aspx
[5] http://mingw-w64.sourceforge.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]