httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: APR errno handling finished.
Date Thu, 06 Apr 2000 01:03:47 GMT

> They way I proposed, errno is the 'primary' code on all platforms, which
> makes the whole concept unnecessary. OS/2 & Win32 are almost identical in
> their error codes. How can it make sense for them to be handled
> differetnly? Why should the use of errno on Windows be banned?
> 
> That would be confusing. The vast majority of OS/2 APR code returns OS/2
> error codes.
> 
> I still think my scheme is much simpler, cleaner, and allows everything we
> want. With the only problem of possible code overflow, it should be easy to
> prove it a non-issue by checking the code range of all platforms. Win32
> looks clear, OS/2 never goes over 2^16. What about BeOS?
> 
> 
> Could everyone look over what I wrote in 
> "Re: ap_status_t for non-unix platforms"
> and comment on it? I even drew a diagram!

The one thing you have failed to do then, is code it.  :-)

I just looked at your diagram.  This is exactly what I coded, with some
minor changes.

1)  Rename APR_OS_START_SYSERR to APR_OS_CANERR.
    (We need a place that we can safely create the canonical error
values.  Currently we use APR_OS_START_SYSERR.  If we use that macro for
both the offset for OS error codes and canonical error codes, we are
asking to confuse programmers and to have conflicts between the two
values.)
  
2)  Rename APR_OS_START_ERRNO2 to APR_OS_START_SYSERR.
3)  Reorder the values so that:

APR_OS_START_ERROR   == 4000
APR_OS_START_STATUS  == 4500
APR_OS_START_USEERR  == 5000
APR_OS_START_CANERR  == 5500
APR_OS_START_SYSERR  == 6000


Done.  That is your proposal exactly.  I have added to it that different
platforms can use different values for those macros if needed.  If that
isn't needed, then we just don't #ifdef them.

I fail to see the difference once the above changes are made.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message