apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject Re: RFC: APR_LARGEFILE flag for APR 0.9
Date Fri, 26 Mar 2004 00:03:29 GMT
On Thu, Mar 25, 2004 at 03:49:09PM -0800, Stas Bekman wrote:
> Jeff Trawick wrote:
> >(Related trivia: Maybe README.dev needs notes on large file support, 
> >starting with the basic Unix requirement you outlined in a PR yesterday
> >
> >export CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
> >./configure
> >
> >and then having folks add comments on platforms where it has been tested 
> >and/or where there are special considerations.)
> 
> That's a bad idea, IMHO, because ARP_HAS_LARGE_FILES will still report 
> false. You suggest to create a mess, where the library will report one 
> thing but behave as another.

I was thinking about this today as well... what do you expect
APR_HAS_LARGE_FILES to actually mean?  "sizeof(apr_off_t) >
sizeof(apr_size_t)"?  or "sizeof(apr_off_t) > off_t"?  or
sizeof(apr_off_t)==8?  Any of these are trivial to implement in the
configure script.

>From below I take it you really want "sizeof(apr_off_t) > off_t"?
That is consistent with what APR implements for Netware and Win32.

It's inconsistent in that for e.g. FreeBSD or any 64-bit Unix, you get
"large files" by default courtesy of a 64-bit off_t, yet
APR_HAS_LARGE_FILES would be 0.

> e.g. in mod_perl we use the following logic to decide whether mp can 
> support large files or not.
> 
> I'd rather see:
> 
> export CPPFLAGS="-ARP_HAS_LARGE_FILES=1"
> 
> or something like that
> 
> /* both perl and apr have largefile support enabled */
> #if defined(USE_LARGE_FILES) && APR_HAS_LARGE_FILES
> #define MP_LARGE_FILES_ENABLED
> #endif
> 
> /* both perl and apr have largefile support disabled */
> #if (!defined(USE_LARGE_FILES)) && !APR_HAS_LARGE_FILES
> #define MP_LARGE_FILES_DISABLED
> #endif
> 
> /* perl largefile support is enabled, apr support is disabled */
> #if defined(USE_LARGE_FILES) && !APR_HAS_LARGE_FILES
> #define MP_LARGE_FILES_PERL_ONLY
> #endif
> 
> /* apr largefile support is enabled, perl support is disabled */
> #if (!defined(USE_LARGE_FILES)) && APR_HAS_LARGE_FILES
> #define MP_LARGE_FILES_APR_ONLY
> #endif
> 
> /* conflict due to not have either both perl and apr
>  * support enabled or both disabled
>  */
> #if defined(MP_LARGE_FILES_APR_ONLY) || defined(MP_LARGE_FILES_PERL_ONLY)
> #define MP_LARGE_FILES_CONFLICT
> #endif
> 
> -- 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message