panic.c
来自「minix操作系统最新版本(3.1.1)的源代码」· C语言 代码 · 共 40 行
C
40 行
#include <stdlib.h>#include "sysutil.h"/*===========================================================================* * panic * *===========================================================================*/PUBLIC void panic(who, mess, num)char *who; /* server identification */char *mess; /* message format string */int num; /* number to go with format string */{/* Something awful has happened. Panics are caused when an internal * inconsistency is detected, e.g., a programming error or illegal * value of a defined constant. */ message m; void (*suicide)(void); if (NULL != who && NULL != mess) { if (num != NO_NUM) { printf("Panic in %s: %s: %d\n", who, mess, num); } else { printf("Panic in %s: %s\n", who, mess); } } /* Exit nicely through PM. */ exit(1); /* If exiting nicely through PM fails for some reason, try to * commit suicide. E.g., message to PM might fail due to deadlock. */ suicide = (void (*)(void)) -1; suicide(); /* If committing suicide fails for some reason, hang. */ for(;;) { }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?