You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@gmail.com> on 2005/03/18 19:54:22 UTC

[PATCH] add APR_SENDFILE_AUTODETECT programming interface

Applications turn on this flag if they want to avoid any sendfile
bogosity, which can be triggered based on hardware or software or
configuration.

AFAIK, Solaris and z/OS are the only platforms that have no sendfile
concerns which the current APR code doesn't already handle, so for
non-{Solaris, z/OS}, sendfile will always return APR_ENOTIMPL when the
APR_SENDFILE_AUTODETECT flag is specified.

Enterprising platform gurus can decide whether or not it is practical
to address all of the platform nuances with sendfile, and if
appropriate modify their platform's sendfile interface.

Example use:

Apache 2.x uses the directive "EnableSendfile Autodetect" to turn on
this APR_SENDFILE_AUTODETECT flag.  The setting for EnableSendfile in
the default configuration file is Autodetect.  Apache will check for
the ENOTIMPL return code and handle as appropriate.

Alternate strategy: APR internally implements the sendfile interface
using other mechanisms, such that applications don't need to check for
APR_ENOTIMPL.

Re: [PATCH] add APR_SENDFILE_AUTODETECT programming interface

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Friday, March 18, 2005 1:54 PM -0500 Jeff Trawick <tr...@gmail.com> 
wrote:

> Applications turn on this flag if they want to avoid any sendfile
> bogosity, which can be triggered based on hardware or software or
> configuration.

Looks fine to me.  Thanks!

> Alternate strategy: APR internally implements the sendfile interface
> using other mechanisms, such that applications don't need to check for
> APR_ENOTIMPL.

I would treat this as an orthogonal (sub-)problem.  We should always define 
APR_HAS_SENDFILE and move in the logic for emulating sendfile into 
apr_socket_sendfile.  This would clean up a major wart in our interfaces that 
we should have dealt with long ago and enables us not to have to return 
APR_ENOTIMPL.

Yet, this can be treated separately from any _AUTODETECT code.

Does that make sense?  -- justin