httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject RE: cvs commit: apache-2.0/src/lib/apr/network_io/os2 os2nerrno.h os2calls.h
Date Mon, 09 Oct 2000 13:32:56 GMT

> From: []
> Sent: Monday, October 09, 2000 1:47 AM
> bjh         00/10/08 23:46:49
>   Modified:    src/lib/apr/include apr_errno.h
>   -#define apr_get_os_error()   (APR_FROM_OS_ERROR(GetLastError()))
>   -#define apr_set_os_error(e)  (SetLastError(APR_TO_OS_ERROR(e)))

Please see the default case (errno) and Win32, and invent something
appropriate here.  These should be defined on all platforms.  Since
Win32 (and perhaps others) won't support lhs assignment, but we are
trying very hard to share code in the unix tree, this is a very simple 
wrapper.  They may be macros or functions, depending.  I'd guess:

   #define apr_get_os_error()    (errno)
   #define apr_set_os_error(e)   (errno = (e))
   #define apr_get_netos_error() (APR_FROM_OS_ERROR(sock_errno()))

would be appropriate for OS2?

I missed that late breaking detail, apr_get_netos_err(), which should
be a wrapper for socket errors.  The neat trick to these macros is that 
we can trust them to move an apr_ system error in or out of the platform
errno or similar.  Of course, I doubt there are set actions for the socket
WSAGetLastError() or sock_errno() functions.

The cool thing about apr_get_netos_error() is that it's declared for
Unix, and could make big chunks of the MPMs more legible where they are 
shared by OS2.  Of course you can suggest I'm out of my mind trying to
introduce this sort of portability.

>   +#define INCL_DOSERRORS
>   +#define INCL_DOS
>   +#include <os2.h>
>   +#include "../network_io/os2/os2nerrno.h"

Ok... I follow this, cool.


View raw message