httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject where to put function to map h_errno values at runtime?
Date Sun, 02 Apr 2000 00:00:48 GMT
h_errno values need to be mapped at run-time.  

  Why, you ask?  

    The four to five different values (depending on the system)
    typically (always?) have values which overlap errno values.
    Currently we map TRY_AGAIN to APR_EAGAIN (but not always) but
    apr_errno.h defines APR_ENODATA to NO_DATA, APR_ENOADDRESS to 
    NO_ADDRESS, and so forth.  This is bad because we expect that
    NO_DATA, NO_ADDRESS, etc. can have the same value as certain
    errnos.  Thus, we define APR_ENODATA, APR_ENOADDRESS, et al to
    unique values and map at run-time.

Here is a function to do that:

ap_status_t status_from_h_errno(int herr)
    ap_status_t status;
    switch(herr) {
        case TRY_AGAIN:
            status = APR_EAGAIN;
        case NO_ADDRESS:
            status = APR_ENOADDRESS;
        (more junk like this)
    return status;

Where does such a beast go?  We don't want to duplicate it through all
the lib/apr/network_io/foo directories, do we?  Also, where do
declarations for internal APR functions go?

(By the way... I'm don't really think that TRY_AGAIN is analogous to EAGAIN,
but that is a separate issue.)

Jeff Trawick | | PGP public key at web site:
          Born in Roswell... married an alien...

View raw message