apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject Re: mmap bug?
Date Thu, 27 Feb 2003 22:41:39 GMT
Joe Orton wrote:

>On Thu, Feb 27, 2003 at 05:10:53PM -0500, Garrett Rooney wrote:
>  
>
>>Joe Orton wrote:
>>    
>>
>>>>>From a quick check, unless I'm screwing something up, it appears that
>>>passing a zero length argument to mmap() doesn't work on several
>>>platforms (nor does it make a whole lot of sense ;): Solaris and HP-UX
>>>both return EINVAL from the the mmap call...
>>>
>>>I'll ask our kernel guys about the Linux case, though I'd guess they'll
>>>say it's undefined behaviour.
>>>
>>>
>>>      
>>>
>>well, in any case, we should define how it will behave in APR, and stick 
>>to it no matter what the underlying platform allows.  either it should 
>>always pass or always succeed (and return an arbitrary pointer or 
>>something).  this is just the kind of os dependent behavior APR should 
>>be letting you ignore.
>>    
>>
>
>Or maybe just document the APR behavior to be undefined if length=0 and
>don't fudge around doing argument validity checking, since creating a
>zero-length mmap isn't a particularly useful feature and supporting it
>adds code complexity.
>

it adds a little code complexity for us, but it simplifies it for all 
our client applications.  i'd prefer to have the complexity happen once, 
in the library, rather than many times in all the client apps.

-garrett



Mime
View raw message