You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Branko Čibej <br...@xbc.nu> on 2003/07/04 03:01:59 UTC

Unused Win32 apr_file_open flags?

In include/arch/win32/apr_arch_file_io.h, we have the following definitions:

/* Internal Flags for apr_file_open */
#define APR_OPENINFO     0x4000    /* Open without READ or WRITE access */
#define APR_OPENLINK     0x2000    /* Open a link itself, if supported */
#define APR_READCONTROL  0x1000    /* Read the file's owner/perms */
#define APR_WRITECONTROL 0x0800    /* Modifythe file's owner/perms */

I see a couple of problems here:

    * APR_READCONTROL and APR_WRITECONTROL are in conflict with
      APR_SENDFILE_ENABLED and APR_FILE_NOCLEANUP, which are defined in
      include/apr_file_io.h.
    * These two flags are never actually checked for in apr_file_open.
      Why are they defined at all?

I'd suggest moving the values of these internal flags into the
0x00100000--0x80000000 range, and adding a note to apr_file_io.h that
those values are reserved for internal flags. Note that the flags
parameter is an apr_int32_t, so that range is always available.

Right now, APR_READCONTROL can get passed to apr_file_open from
apr_stat, but is then interpreted as APR_SENDFILE_ENABLED ... weird, to
say the least.

Thoughts? If nobody objects, I'll make that change soonish. Somebody
should probably check the other platforms for similar overlap, 

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


Re: Unused Win32 apr_file_open flags?

Posted by Branko Čibej <br...@xbc.nu>.
William A. Rowe, Jr. wrote:

>I don't see any issues with your suggestions below.  I'll sanity check
>your commit after you've finished (if you haven't already) :-)
>
It's done already. No external changes, just the values in the win32
apr_arch_file_io.h changed, and I added a note to apr_file_io.h about
the reserved range.

    Brane

>Bill
>
>At 08:01 PM 7/3/2003, Branko ÄŒibej wrote:
>  
>
>>In include/arch/win32/apr_arch_file_io.h, we have the following definitions:
>>
>>/* Internal Flags for apr_file_open */
>>#define APR_OPENINFO     0x4000    /* Open without READ or WRITE access */
>>#define APR_OPENLINK     0x2000    /* Open a link itself, if supported */
>>#define APR_READCONTROL  0x1000    /* Read the file's owner/perms */
>>#define APR_WRITECONTROL 0x0800    /* Modifythe file's owner/perms */
>>
>>I see a couple of problems here:
>>
>>   * APR_READCONTROL and APR_WRITECONTROL are in conflict with
>>     APR_SENDFILE_ENABLED and APR_FILE_NOCLEANUP, which are defined in
>>     include/apr_file_io.h.
>>   * These two flags are never actually checked for in apr_file_open.
>>     Why are they defined at all?
>>
>>I'd suggest moving the values of these internal flags into the
>>0x00100000--0x80000000 range, and adding a note to apr_file_io.h that
>>those values are reserved for internal flags. Note that the flags
>>parameter is an apr_int32_t, so that range is always available.
>>
>>Right now, APR_READCONTROL can get passed to apr_file_open from
>>apr_stat, but is then interpreted as APR_SENDFILE_ENABLED ... weird, to
>>say the least.
>>
>>Thoughts? If nobody objects, I'll make that change soonish. Somebody
>>should probably check the other platforms for similar overlap, 
>>
>>-- 
>>Brane ÄŒibej   <br...@xbc.nu>   http://www.xbc.nu/brane/
>>    
>>
>
>
>  
>


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


Re: Unused Win32 apr_file_open flags?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
I don't see any issues with your suggestions below.  I'll sanity check
your commit after you've finished (if you haven't already) :-)

Bill

At 08:01 PM 7/3/2003, Branko Čibej wrote:
>In include/arch/win32/apr_arch_file_io.h, we have the following definitions:
>
>/* Internal Flags for apr_file_open */
>#define APR_OPENINFO     0x4000    /* Open without READ or WRITE access */
>#define APR_OPENLINK     0x2000    /* Open a link itself, if supported */
>#define APR_READCONTROL  0x1000    /* Read the file's owner/perms */
>#define APR_WRITECONTROL 0x0800    /* Modifythe file's owner/perms */
>
>I see a couple of problems here:
>
>    * APR_READCONTROL and APR_WRITECONTROL are in conflict with
>      APR_SENDFILE_ENABLED and APR_FILE_NOCLEANUP, which are defined in
>      include/apr_file_io.h.
>    * These two flags are never actually checked for in apr_file_open.
>      Why are they defined at all?
>
>I'd suggest moving the values of these internal flags into the
>0x00100000--0x80000000 range, and adding a note to apr_file_io.h that
>those values are reserved for internal flags. Note that the flags
>parameter is an apr_int32_t, so that range is always available.
>
>Right now, APR_READCONTROL can get passed to apr_file_open from
>apr_stat, but is then interpreted as APR_SENDFILE_ENABLED ... weird, to
>say the least.
>
>Thoughts? If nobody objects, I'll make that change soonish. Somebody
>should probably check the other platforms for similar overlap, 
>
>-- 
>Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/