httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: cvs commit: apache-2.0/src/lib/apr/misc/unix errorcodes.c
Date Thu, 20 Apr 2000 18:37:15 GMT

Okay, we had this discussion a few weeks ago.  I will re-hash the problems
with the different approaches that were discussed, and the current
approach here:

Possible approaches:

1)  Have all platforms return common error codes.
2)  Have all platforms return unique error codes and provide a routine to
convert to a common error code.

The problem with the first approach, is that it is a lossy
conversion.  Windows and OS/2 have hundreds of error codes, errno
doesn't.  If APR does the conversion every time, then there is no way to
retrieve a meaningful human readable string in apr_strerror.

The problem with the second approach is that it requires programmers to
call the conversion routine (ap_canonical_error) in order to get a common
error code.  This wouldn't be necessary if the status codes were the
useful structure they were originall designed as.  But, they aren't, they
are a single integer.

We are taking the approach that a USEFUL contextual error string is very
important.  Since we are using errno as the common error code (because it
is the lowest common denominator), we are limited to around 124 error
codes (according to me Linux errno.h file).  Windows and OS/2 have far
more error codes than this, so two codes will resolve to the same errno
value.  When we want to generate a human readable string, how do we
determine which error code was actual generated?

Please read the APRDesign doc, because I just checked, it is correct, and
it details how the error code stuff works.

If you have any other suggestions for how to deal with this problem,
please let us know.


On Thu, 20 Apr 2000, Rodent of Unusual Size wrote:

> wrote:
> > 
> > The primary error code on ALL platforms is errno.
> Um, no.  That makes a mockery of the whole idea of portability.
> Which is APR's whole purpose for being.  You do NOT impose the
> concepts from one environment onto another; you figure out a
> way to make the upper layers not know the difference.
> I suspect you mean that the decided-upon design is one that makes
> all platform-specific errors look *like* the errno model.
> > The Windows native error codes should be APR_OS_START_SYSERR +
> > native code.
> Uh-uh.  If you're going to do that, there's no point in reserving
> a block at all -- you're just going to remap ALL platform codes
> into your arbitrary and artificial range.
> > I'm not sure if the docs are correct right now
> Then they should be verified -- they're what people are
> depending upon in order to progress properly.
> -- 
> #ken    P-)}
> Ken Coar                    <http://Golux.Com/coar/>
> Apache Software Foundation  <>
> "Apache Server for Dummies" <http://Apache-Server.Com/>
> "Apache Server Unleashed"   <http://ApacheUnleashed.Com/>

Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message