src/projects/libc/stdlib/abort.c
__attribute__((__noreturn__))
void abort(void) {
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCDFAInspection"
#ifdef __is_kernel
    // TODO Add proper kernel panic.
    printf("kernel: panic: abort()\n");
    while (1) {}
    __builtin_unreachable();
#endif // __is_kernel
#ifdef __is_user
    // TODO Abnormally terminate the process as if by SIGABRT.
    printf("abort()\n");
    while (1) {}
    __builtin_unreachable();
#endif // __is_user
#pragma clang diagnostic pop
}
/*
 * Terminate the current process abnormally.
 *
 * This will trigger a kernel panic, when invoked in the kernel, and terminate the current process, when called from
 * userspace.
 */
Terminate the current process abnormally.
This will trigger a kernel panic, when invoked in the kernel, and terminate the current process, when called from
userspace.
Terminate the current process abnormally . This will trigger a kernel panic when invoked in the kernel and terminate the current process when called from userspace .
__attribute__((__noreturn__))
void abort(void) {
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCDFAInspection"
#ifdef __is_kernel
    printf("kernel: panic: abort()\n");
    while (1) {}
    __builtin_unreachable();
#endif 
#ifdef __is_user
    printf("abort()\n");
    while (1) {}
    __builtin_unreachable();
#endif 
#pragma clang diagnostic pop
}
__attribute__ ( ( __noreturn__ ) ) void abort ( void ) { #pragma  clang diagnostic push #pragma  ide diagnostic ignored "OCDFAInspection" #ifdef __is_kernel printf ( " \n " ) ; while ( 1 ) { } __builtin_unreachable ( ) ; #endif #ifdef __is_user printf ( " \n " ) ; while ( 1 ) { } __builtin_unreachable ( ) ; #endif #pragma  clang diagnostic pop }
Terminate the current process abnormally.
Terminate the current process abnormally .
// TODO Add proper kernel panic. // __is_kernel // TODO Abnormally terminate the process as if by SIGABRT. // __is_user