httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: Errno code in APR again.
Date Sat, 08 Apr 2000 07:43:35 GMT
On Fri, 7 Apr 2000 12:03:43 -0400 (EDT), wrote:

>>    Your prototype is certainly the one I would like to have.  However,
>>    you may recall from my previous post of an ap_strerror()
>>    implementation that  Windows has a special storage management
>>    requirement associated with retrieving the description for an OS
>>    error code.  To avoid storage leaks or even uglier interfaces, the
>>    ap_strerror() caller needs to provide a buffer for the description
>>    (and thus a buffer length).
>No, I didn't see that post.  Fine, change the API.  It's not critical, the
>idea was what I wanted to get across.

OS/2 will also need to allocate some memory. ap_strerror() should take a
context for memory to be allocated from rather than mucking about with
buffers in the application code, as in

const char *ap_strerror(ap_status_t err, struct ap_context_t *ctx);

In the case of an 'out of memory' error, it can return a literal string.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message