APR seems to be missing the O_NONBLOCK flag to apr_file_open. This
means that calls to open on named pipes will block until the producer
has opened the pipe for writing. Is this intended? I have no idea
how this works on win32, but a patch for unix is attached..
-Ryan
Index: srclib/apr/file_io/unix/open.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/unix/open.c,v
retrieving revision 1.76
diff -u -r1.76 open.c
--- srclib/apr/file_io/unix/open.c 2001/06/07 14:32:15 1.76
+++ srclib/apr/file_io/unix/open.c 2001/07/02 04:18:50
@@ -141,7 +141,11 @@
if (flag & APR_TRUNCATE) {
oflags |= O_TRUNC;
}
-
+
+ if (flag & APR_NONBLOCK) {
+ oflags |= O_NONBLOCK;
+ }
+
if (perm == APR_OS_DEFAULT) {
(*new)->filedes = open(fname, oflags, 0666);
}
Index: srclib/apr/include/apr_file_io.h
===================================================================
RCS file: /home/cvspublic/apr/include/apr_file_io.h,v
retrieving revision 1.102
diff -u -r1.102 apr_file_io.h
--- srclib/apr/include/apr_file_io.h 2001/05/31 00:11:12 1.102
+++ srclib/apr/include/apr_file_io.h 2001/07/02 04:19:10
@@ -89,6 +89,7 @@
#define APR_SHARELOCK 1024 /* Platform dependent support for higher
level locked read/write access to support
writes across process/machines */
+#define APR_NONBLOCK 2048 /* Open call will be non-blocking. */
/* flags for apr_file_seek */
#define APR_SET SEEK_SET