Back to index

glibc  2.9
Functions
mach_error.c File Reference
#include <stdio.h>
#include <mach_error.h>
#include <mach/boolean.h>

Go to the source code of this file.

Functions

char * mach_error_string_int (mach_error_t, boolean_t *)
void mach_error (char *str, mach_error_t err)

Function Documentation

void mach_error ( char *  str,
mach_error_t  err 
)

Definition at line 66 of file mach_error.c.

{
       char * err_str;
       char buf[1024];
       boolean_t diag;

       err_str=mach_error_string_int(err, &diag);

       if ( diag ) {
              sprintf( buf, "%s %s (%x)", mach_error_type(err), err_str, err );
              err_str = buf;
       }

       fprintf(stderr, "%s %s\n", str, err_str);
}

Here is the call graph for this function:

char* mach_error_string_int ( mach_error_t  ,
boolean_t *   
)

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: