apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@rkbloom.net>
Subject Re: rc and errno in apr api
Date Mon, 17 May 2004 10:36:27 GMT
On Sun, 16 May 2004, Cliff Woolley wrote:

> On Sun, 16 May 2004, Stas Bekman wrote:
> > What I'm after is having APR API specify which apr functions have errno set,
> > so one can rely on that and not do guessing which can change in the future.
> My gut reaction is that if we actually /need/ errno to be set to glean
> useful information about what happened, we did something wrong in choosing
> which apr_status_t's could be returned from that function.

Cliff is correct, but I would go one step further.  Any APR api that is
setting errno is doing so by chance.  It would be perfectly valid
(although stupid) for us to add errno=0 at the end of every APR function.
Also, for portability reasons, you really can't rely on errno at all.
Windows only uses it sporatically, and for every function in APR
(including apr_file_open) there are some paths that will set errno and
others that won't.


View raw message