cURL / Mailing Lists / curl-library / Single Mail


Re: Question about curl_off_t

From: Jamie Lokier <>
Date: Mon, 6 Aug 2007 16:26:50 +0100

Patrick Monnerat wrote:
> This is then in conflict with the libcurl compiled library, and may
> cause problem when passing curl_off_t values to curl_easy_setopt()
> (there may be other cases, but I did not check them all).
> The current implementation forces calling applications to be compiled in
> _LARGE_FILES mode.
> I think curl_off_t type (and associated values) must be determined at
> configure time, then substituted into the curl.h header file, in order
> to always have coherent definitions. For example from a
> file... any other clever idea ???

An alternative is that curl_off_t is always defined to be off_t when
an application is compiled, but have curl_easy_setopt() be a macro
whose definition depends on whether the application is compiled with
32-bit off_t or 64-bit off_t.

That macro could set an additional flag in the option number to
curl_easy_setopt(), for example, informing the library's
curl_easy_setopt() to convert the argument to the size used by the
library for off_t arguments.

Or alternatively, the library could contain curl_easy_setopt() and
curl_easy_setopt64(), with the header files mapping one to the other,
the same way as functions like open() are mapped to open64().

-- Jamie
Received on 2007-08-06