cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: LONG_MAX patch

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Thu, 15 Jan 2004 15:24:35 +0100

"Daniel Stenberg" <daniel-curl_at_haxx.se> said:

> Doesn't windows provide an 'off_t' type larger than 32 bits? If so, then

No, 'off_t' (actually '_off_t') is 'long' on all I've checked (MSVC v6, MingW
Watcom and Digital Mars).

> LONG_MAX shouldn't be needed in src/main.c since the code uses LLONG_MAX
> instead... Also, if it does provide that, is there a strtoll() or similar
> function to convert from a string to such a value?

Only MingW and Digital Mars have strtoll().

> I would guess that Windows has support for large files somehow!

Natively it does, but in the various libc it's little support for it.
There is fstati64(), telli64(), lseeki64() etc. in MingW/MSVC (not the
libc, but in the MSVCRT.DLL), so resuming >2GB files should work.
I think using e.g. fwrite() on large files works fine.

They all have 64-bit longs ('long long' or '__int64'). So 'filesize_t' should
be careful not to use use 64 bit file-offsets.

--gv

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Received on 2004-01-15