Changeset e464759 for src/libcfa
- Timestamp:
- Apr 27, 2017, 1:54:41 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0c78741
- Parents:
- 075d862
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/interpose.c
r075d862 re464759 26 26 27 27 #include "libhdr/libdebug.h" 28 #include "libhdr/libtools.h" 28 29 #include "startup.h" 29 30 void abortf( const char *fmt, ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__));31 30 32 31 void interpose_startup(void) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) )); … … 115 114 static char abort_text[ abort_text_size ]; 116 115 117 void abortf( const char fmt[], ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) { 118 void * kernel_data = kernel_abort(); 119 120 int len; 121 122 if( fmt ) { 123 va_list args; 124 va_start( args, fmt ); 116 extern "C" { 117 void abortf( const char fmt[], ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) { 118 void * kernel_data = kernel_abort(); 125 119 126 len = vsnprintf( abort_text, abort_text_size, fmt, args );120 int len; 127 121 128 va_end( args ); 122 if( fmt ) { 123 va_list args; 124 va_start( args, fmt ); 129 125 126 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 127 128 va_end( args ); 129 130 __lib_debug_write( STDERR_FILENO, abort_text, len ); 131 __lib_debug_write( STDERR_FILENO, "\n", 1 ); 132 } 133 134 len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld)\n", (long int)getpid() ); // use UNIX pid (versus getPid) 130 135 __lib_debug_write( STDERR_FILENO, abort_text, len ); 131 __lib_debug_write( STDERR_FILENO, "\n", 1 );132 }133 134 len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld)\n", (long int)getpid() ); // use UNIX pid (versus getPid)135 __lib_debug_write( STDERR_FILENO, abort_text, len );136 136 137 137 138 kernel_abort_msg( kernel_data, abort_text, abort_text_size );138 kernel_abort_msg( kernel_data, abort_text, abort_text_size ); 139 139 140 libc_abort(); 140 libc_abort(); 141 } 141 142 } -
src/libcfa/libhdr/libtools.h
r075d862 re464759 22 22 // } // libAbort 23 23 24 #define abortf(...) abort(); 25 24 #ifdef __cforall 25 extern "C" { 26 #endif 27 void abortf( const char fmt[], ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)); 28 #ifdef __cforall 29 } 30 #endif 26 31 27 32 #endif //__LIB_TOOLS_H__
Note: See TracChangeset
for help on using the changeset viewer.