Back to index

glibc  2.9
Defines | Functions | Variables
errstring.c File Reference
#include <mach/boolean.h>
#include <mach/error.h>
#include <mach_error.h>
#include <errorlib.h>

Go to the source code of this file.

Defines

#define EXPORT_BOOLEAN

Functions

void __mach_error_map_compat (mach_error_t *)
const char * mach_error_type (mach_error_t err)
const char * mach_error_string_int (mach_error_t err, boolean_t *diag)
const char * mach_error_string (mach_error_t err)

Variables

boolean_t mach_error_full_diag = FALSE

Define Documentation

#define EXPORT_BOOLEAN

Definition at line 40 of file errstring.c.


Function Documentation

Definition at line 40 of file error_compat.c.

{
       mach_error_t         err = *org_err;

       /*
        * map old error numbers to
        * to new error sys & subsystem
        */

       if ((-200 < err) && (err <= -100))
              err = -(err + 100) | IPC_SEND_MOD;
       else if ((-300 < err) && (err <= -200))
              err = -(err + 200) | IPC_RCV_MOD;
       else if ((-400 < err) && (err <= -300))
              err = -(err + 300) | MACH_IPC_MIG_MOD;
       else if ((1000 <= err) && (err < 1100))
              err = (err - 1000) | SERV_NETNAME_MOD;
       else if ((1600 <= err) && (err < 1700))
              err = (err - 1600) | SERV_ENV_MOD;
       else if ((27600 <= err) && (err < 27700))
              err = (err - 27600) | SERV_EXECD_MOD;
       else if ((2500 <= err) && (err < 2600))
              err = (err - 2500) | KERN_DEVICE_MOD;
       else if ((5000 <= err) && (err < 5100))
              err = (err - 5000) | BOOTSTRAP_FS_MOD;

       *org_err = err;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 89 of file errstring.c.

{
       boolean_t diag;

       return mach_error_string_int( err, &diag );

}

Here is the call graph for this function:

const char* mach_error_string_int ( mach_error_t  err,
boolean_t *  diag 
)

Definition at line 67 of file errstring.c.

{
       int sub, system, code;

       __mach_error_map_compat( &err );

       sub = err_get_sub(err);
       system = err_get_system(err);
       code = err_get_code(err);

       *diag = TRUE;

       if (system > err_max_system) return( "(?/?) unknown error system" );
       if (sub >= errors[system].max_sub) return( errors[system].bad_sub );
       if (code >= errors[system].subsystem[sub].max_code) return ( NO_SUCH_ERROR );

       *diag = mach_error_full_diag;
       return( errors[system].subsystem[sub].codes[code] );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 49 of file errstring.c.

{
       int sub, system;

       __mach_error_map_compat( &err );

       sub = err_get_sub(err);
       system = err_get_system(err);

       if (system > err_max_system
       ||  sub >= errors[system].max_sub ) return( "(?/?)" );
       return( errors[system].subsystem[sub].subsys_name );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 64 of file errstring.c.