cURL / Mailing Lists / curl-library / Single Mail



From: Yang Tse <>
Date: Wed, 20 Aug 2008 07:59:31 +0200

2008/8/19, Daniel Stenberg wrote:

> You wrote in TODO-RELEASE:
> > * System off_t, or equivalent, size must be recorded in curlbuild.h
> What is the purpose of storing that there? I assume you mean the size of
> off_t as used when libcurl is built (with LFS on/off the same way)? That
> should already be recorded by the configure script.

Yes, with 'system off_t size' I meant the size that the 'standard'
off_t type had when libcurl was built, whichever it was.

The need to store it in curlbuild.h is to allow the user of an already
built libcurl library, which has been distributed only in binary +
header files, to know at compile time if the LFS settings used for the
application match those of libcurl.

libcurl headers will not enable or disable LFS on the app using them,
but the app linking with libcurl should have the same LFS settings.

I'm not 100% sure that _all_ apps linking with libcurl should have the
same LFS settings. But there will be cases in which mixing LFS enabled
system IO libs with LFS disabled system IO libs in the same app will
trigger 'funny' behaviour. Others might be capable of elaborating on
this more thoroughly.

The really nasty word in the quoted statement is 'equivalent'. There
might be no 'off_t' data type, but it can be named loff_t, offset_t,
fpos_t, off64_t, and who knows what else.

And then we have our 'special' WIN32 builds which are capable of LFS
on their own (with some help) ;-)

> For getting the size to do the checks I mentioned previously in the "Binary
> compatibility and 64-bit curl_off_t" thread[*], we need to figure out if LFS
> is explicity disabled on a system that otherwise could support it. I'm not
> sure how this can be done in any easy manner. The AC_SYS_LARGEFILE macro
> doesn't seem to disclose this info.

sizeof(off_t) before and after AC_SYS_LARGEFILE perhaps ?

But doing 'configure --disable-largefile' on systems which don't need
any additional definition to enable LFS won't do anything at all and
LFS will remain enabled. This is my understanding as of today.

Received on 2008-08-20