apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject rc and errno in apr api
Date Mon, 17 May 2004 03:17:41 GMT
I have noticed that besides apr_status_t many of the apr api functions get 
errno set on error, since they perform system calls internally, which set 
errno. e.g. apr_file_read.

While writing interfaces for other systems, that talk to libapr, and use errno 
for the errors handling, it's not possible to simply set errno to apr_status_t 
returned by some apr calls, since in several cases that code/errstr is 
specific to apr and there will be no equivalent in the errno posix land. So 
there is no 1:1 mapping between apr_status_t and errno. When there is a 
mismatch some alternative solution is out to be found.

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. 
For example it seems that apr_file_read will always have errno set on failure. 
But I have no idea about other functions, especially since there are several 
platform specific implementations of each.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message