You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Dale Ghent <da...@elemental.org> on 2002/08/14 00:26:03 UTC

Patch to enable large file support in APR

The following patch and file allows for the detection and use of POSIX
large file implentations that exist in most modern OSes.

"Large files" refers to files that are greater than 2GB in size. Without
LF support, a program will typically crash or otherwise fail if an attempt
is made to open or write/read to a file (or memeory-mapped region) that is
over 2GB in size.

In terms of Apache, this allows log files to grow beyond 2GB, as well as
the ability to serve files that are > 2GB.

*Possible* Caveat: Attempting to serve a large file over a SSL connection
can possibly fail. This is not the fault of Apache or APR, but with the
OpenSSL routines that Apache uses to manage SSL connections. A work-around
is to recompile OpenSSL with large file support, or to serve the content
via a non-SSL connetion if possible.

I havnt had the time to test this theory, but I ran into it while
benchmarking OpenSSH (which uses OpenSSL) not too long ago. The fix there
as to recompile OpenSSL with LF support. I gather the situation would be
the same here, too. If anyone has a chance to give this a whirl, let me or
the list know.

Anyhow, the patch to apr/configure.in and a new file,
apr/build/apr_largefile.m4 are attached.

/dale






Re: Patch to enable large file support in APR

Posted by Dale Ghent <da...@elemental.org>.
On Mon, 19 Aug 2002, Justin Erenkrantz wrote:

| This is generally good, but what would be *really* nice is that
| if we can add some logic to apr_hints.m4 so that Linux does not
| use largefiles unless --enable-largefile is explicitly passed.
| The reason for that is Linux disables sendfile() when largefile
| support is activated.

It's good that we have people around that know their respective OSes :)

I'll work on that. Can anyone else think of additional caveats that are
similar for other OSes ?

Also, should I add a "-D APR_HAS_LARGEFILES" flag to the APR features
listing? I think that would be useful on at least an informational basis.
A admin/developer might want largefiles for his/her app, but not think or
know to 'nm libapr.so | grep 64$' to find out if it's ragu.

/dale


Re: Patch to enable large file support in APR

Posted by Justin Erenkrantz <je...@apache.org>.
On Tue, Aug 13, 2002 at 06:26:03PM -0400, Dale Ghent wrote:
> 
> The following patch and file allows for the detection and use of POSIX
> large file implentations that exist in most modern OSes.

This is generally good, but what would be *really* nice is that
if we can add some logic to apr_hints.m4 so that Linux does not
use largefiles unless --enable-largefile is explicitly passed.
The reason for that is Linux disables sendfile() when largefile
support is activated.

If you have any questions on how to do this, ask.  =) -- justin