Graham Leggett
Mon, 08 Mar 2010 07:00:27 -0800
On 08 Mar 2010, at 12:54 AM, Jeff Trawick wrote:
On Sun, Mar 7, 2010 at 10:24 AM, <minf...@apache.org> wrote:Author: minfrin Date: Sun Mar 7 15:24:36 2010 New Revision: 920017 URL: http://svn.apache.org/viewvc?rev=920017&view=rev Log: Backport r920016: Enable platform specific support for the opening of a file or pipe in non blocking module through the APR_FOPEN_NONBLOCK flag.I don't believe that versioning rules allow this to be added to the 1.4.x branch.
True, let me revert. It's been confusing with apr v1.4 being released but apr-util v1.4 not.
+#ifdef O_NONBLOCK + if (flag & APR_FOPEN_NONBLOCK) { + oflags |= O_NONBLOCK; + }#else result is APR_ENOTIMPL?
Hmmm, the existing code follows this pattern, as below, and if we decide to change the pattern then we need to change this behaviour throughout the rest of the code, and probably the rest of APR too. I'm not sure I like returning APR_ENOTIMPL without an API present for a caller to confirm whether these functions work on a particular platform.
#ifdef O_BINARY
if (flag & APR_FOPEN_BINARY) {
oflags |= O_BINARY;
}
#endif
#ifdef O_NONBLOCK
if (flag & APR_FOPEN_NONBLOCK) {
oflags |= O_NONBLOCK;
}
#endif
#ifdef O_CLOEXEC
/* Introduced in Linux 2.6.23. Silently ignored on earlier Linux
kernels.
*/
if (!(flag & APR_FOPEN_NOCLEANUP)) {
oflags |= O_CLOEXEC;
}
#endif
#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
oflags |= O_LARGEFILE;
#elif defined(O_LARGEFILE)
if (flag & APR_FOPEN_LARGEFILE) {
oflags |= O_LARGEFILE;
}
#endif
Regards,
Graham
--