#include #include "stdio.h" #include "stdlib.h" // abaos has a kernel_panic function // TODO: we should not need this stub, rather, libc functions should // use other means to abort the process (e.g. with abort), then the // kernel should catch this exception and issue the kernel_panic itself. // anyway: the kernel has to decide whether it dies in panic or it // kills the culprid child an merely goes his way.. void kernel_panic( const char *format, ... ) { (void)printf( "\n*** KERNEL PANIC ***\n" ); va_list args; va_start( args, format ); (void)vprintf( format, args ); va_end( args ); puts( "" ); exit( 255 ); } uintptr_t __stack_chk_guard = STACK_CHK_GUARD; __attribute__( ( noreturn ) ) void __stack_chk_fail_local( void ) { abort( ); } __attribute__( ( noreturn ) ) void __stack_chk_fail( void ) { kernel_panic( "Stack smashing detected!" ); // make gcc happy on noreturn does return for( ;; ); }