apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Poirier" <poir...@pobox.com>
Subject Re: apr_file_open() and non blocking IO
Date Sun, 28 Feb 2010 12:20:37 GMT
On Sat, 27 Feb 2010 16:19 +0200, "Graham Leggett" <minfrin@sharp.fm>
wrote:
> I am trying to open a fifo on disk with the O_NONBLOCK flag set, and I  
> notice that apr's apr_file_open() cannot do this.
> 
> As a result, if nobody else is already reading from the fifo,  
> apr_file_open blocks, and this is the behaviour I want to avoid.
> 
> Does anyone know of any reason why this wouldn't work?

Seems reasonable.  Have you tried it, or is this still hypothetical?

> Index: include/apr_file_io.h
> ===================================================================
> --- include/apr_file_io.h       (revision 916953)
> +++ include/apr_file_io.h       (working copy)
> @@ -81,6 +81,8 @@
>   #define APR_FOPEN_SPARSE      0x08000 /**< Platform dependent flag  
> to enable
>                                          * sparse file support, see  
> WARNING below
>                                          */
> +#define APR_FOPEN_NONBLOCK    0x10000 /**< Platform dependent flag to  
> enable
> +                                       * non blocking file io */
> 
>   #define APR_FOPEN_ROTATING  0x10000 /**< Do file file rotation  
> checking */

It looks like the new flag is using the same bit as APR_FOPEN_ROTATING.

Dan

Mime
View raw message